typemock

Typemock not integerating with VS2017 and NUnit3

寵の児 提交于 2019-12-23 19:00:15
问题 Trying to debug tests that use TypeMock and I get the following error: TypeMock.TypeMockException: ' *** Typemock Isolator is currently disabled. Enable using the following: * Within Visual Studio: - Use Typemock Smart Runner - For other runners, Choose Typemock Menu and click "Integrate with Other Runners" * To run Typemock Isolator as part of an automated process you can: - run tests via TMockRunner.exe command line tool - use 'TypeMockStart' tasks for MSBuild or NAnt For more information

EF4 - possible to mock ObjectContext for unit testing?

此生再无相见时 提交于 2019-12-18 16:49:39
问题 Can it be done without using TypeMock Islolator? I've found a few suggestions online such as passing in a metadata only connection string, however nothing I've come across besides TypeMock seems to truly allow for a mock ObjectContext that can be injected into services for unit testing. Do I plunk down the $$ for TypeMock, or are there alternatives? Has nobody managed to create anything comparable to TypeMock that is open source? 回答1: I'm unit testing EF4 easily without mocking. What I did

unit testing legacy code: limits of “extract and override” vs JustMock/TypeMock/moles?

无人久伴 提交于 2019-12-12 15:04:38
问题 Given the following conditions: a very old, big, C# legacy code base with no testcoverage whatsoever (almost) every class derives from some interface nothing is sealed What are the practical benefits of using profiler-API-driven solutions like JustMock and TypeMock, compared to using extract&override + e.g. RhinoMocks? Are there cases I'm not aware of, besides circumventing private/protected, where using TypeMock/JustMock etc. is really needed ? I'd especially welcome some experience from

Typemock Isolator: Mock a dependency that's not injected?

江枫思渺然 提交于 2019-12-12 12:23:10
问题 My WidgetDoer class depends on Foo , which is not injected. I need to fake _foo 's implementation of DoStuffWith() (and then verify that Do() returned the result -- this is a simplified representation of my real code). public class WidgetDoer { readonly Foo _foo; public WidgetDoer() { _foo = new Foo(); } public Bar Do(Widget widget) { var result = _foo.DoStuffWith(widget); return result; } } I tried to use the following Isolator syntax to prevent a real Foo object from being created (inside

Running Unit Test having Operation could destablize the runtime exception at new StandardKernel

久未见 提交于 2019-12-11 05:52:08
问题 In our unit tests where it first load db setting from a singleton class, we have: IKernel kernel = new StandardKernel(new OurInfrastructureNinjectModule()); _myService = kernel.Get<MyService>(); // To inject a concrete to myService It runs fine in our mvc application, however, exception threw when it is called by unit tests. 回答1: Note: I work at Typemock Due to changes in security in .NET 4, there was a bug in Typemock Isolator where code running from assemblies marked with

Typemock vs Moq [closed]

泪湿孤枕 提交于 2019-12-10 17:41:41
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I have heard/read a little about both of these frameworks and have decided I want to use of of the two. Which is better? Why? Thanks

How does “Typemock Isolator” mock static methods?

落爺英雄遲暮 提交于 2019-12-09 08:52:49
问题 As some of you will know, it is generally not possible to mock a static method in .net. By mocking, I mean to replace a method in a class with another method with the same signature, usually for testing purposes. The two main methods used for mocking a method are to declare it virtual or define it in an interface. Neither of these two are allowed for .net static methods. However, there is an expensive tool called "Typemock Isolator" which allows for mocking of static methods. How does

How to mock everything?

半世苍凉 提交于 2019-12-08 18:27:48
问题 I understand how to mock interfaces or virtual method calls. But frameworks like TypeMock can mock everything in the framework. Which .NET mechanisms are used to provide such functions? 回答1: Typemock Isolator for example uses the CLR profiler API to intercept .NET calls and change them during runtime: Quote: Typemock Isolator uses an aspect-oriented programming design that creates a mock aspect. Internally, it uses the .NET Framework profiler API to monitor an application's execution. When a

TypeMock VS JustMock (VS RhinoMock,Moq…): current situation in 2011? [closed]

你离开我真会死。 提交于 2019-12-06 20:18:41
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 29 days ago . I've started TDD some weeks ago. I have to do Unit Tests on a C# code full of non-virtual methods and there is no much interface either. Therefore, after I've been studying RhinoMock and Moq, a proxy solution wasn't enough: what I need is an isolation thanks to a profiler.

TypeMock VS JustMock (VS RhinoMock,Moq…): current situation in 2011? [closed]

末鹿安然 提交于 2019-12-05 01:39:01
I've started TDD some weeks ago. I have to do Unit Tests on a C# code full of non-virtual methods and there is no much interface either. Therefore, after I've been studying RhinoMock and Moq, a proxy solution wasn't enough: what I need is an isolation thanks to a profiler. From what I read, I have 3 choices: TypeMock Isolator, very powerful but also very expensive http://www.typemock.com/ JustMock of Telerik, the alternative to TypeMock which aims to be TypeMock, but the beta was full of bugs http://www.telerik.com/products/mocking.aspx Moles from Microsoft Pex, the only free solution for