typemock

NCover, TypeMock and MSTest

Hi, has anyone got NCover, TypeMock and MSTest to work together? and if so how. I've had 2 or 3 serious tries at this now and just can't get it to work. I'm using MSTest 9, NCover 2.1 and TypeMock 4.1. Ideally I would like to run them from an MSBuild task. Cheers Mat ...

Rhino Mocks, TypeMock, Moq, or NMock? Which one do you use and why?

Which one do you use (if you use the listed ones) and what do you love and even hate about it? ...

What are the capabilities of Moq and Rhino.mocks?

I cannot find a specific feature-by-feature comparison of Moq and Rhino. All the questions are "which do you like better and why", or "here's how you do a simple mock in rhino and how it's done in moq". I cannot find a deep comparison anywhere. I'm aware of the syntax differences, I'm not looking for answers about that. I am looking ...

TypeMock ExpectConstructor(): Why does this test pass?

I'm a little confused as to the purpose of the ExpectConstructor() method on the Mock class in TypeMock 3.5. I would have thought that calling ExpectConstructor would cause the MockManager to fail upon Verify() if the constructor is not called, i.e. if an instance of the mocked type is not instantiated. However, calling ExpectConstruc...

Unit Testing: TypeMocking a singleton

Hi I'm using TypeMock Isolater to mock up some objects for some unit tests - attempting to use the AAA api (so the Isolate calls). I have a straightforward singleton class where you call a static GetInstance(), which then returns an instance of the class. I thought it would be a simple matter of mocking that up, but I'm running into a ...

bypass dispose for testing

Hi I'm trying to test a method. I want to ensrur that there is a method call in that method (calling service) the code look like this: using(proxy = new Proxy()) { proxy.CallService(); } I swap the proxy with fake object (using TypeMock) but get error because of the fake object disposed in the end of block. I don't want to ...

Mocking non-virtual Events (In COM interop classes)

Edit: Language/Platform is C# / .Net I'm currently trying to fill a vast unit-test void in my current project, and being admittedly new to TDD, find myself quite stumped as to how to go about testing some of the more business-critical features. I picked up Moq and had an easy enough time doing simple mocks, however at the core of my ap...

Using typemock for chaining

I am just starting here with mocking about, and I am trying something which I think should be quite simple. I have a class that reads Google calendar data. First, it creates a CalendarService object, then it calls Query on that object, receives a EventFeed and iterates on the Item collection of AtomEntryCollection. I want it all to be m...

How to use TypeMock Isolator with Linq to SQL and DataContext

Hi, i am using TypeMock Isolator to fake the tables on my DataContext like this: Isolate.Swap.CallsOn(ctx.GetTable<TTable>()).WithCallsTo(content); I now can fill the "database" with arbitrary data on each test. In order to get meaningful data for the test scenario into the DataContext i usually have to create 3-5 objects. Now, the p...

Getting arguments of a called Typemock mocked method

Hi all, I am a keen user of RhinoMocks developing from a TDD and AAA perspective with NUnit and ReSharper. I am changing jobs and the team I am moving to uses TypeMock so I want to hit the ground running... and I have run into a problem. How can I get the arguments for a called method on a mock object. When using RhinoMocks I use: mock...

Mocking non-virtual methods in C#

I'm trying to test some classes I've made using mocks, but I've seen all free mocking frameworks in c# aren't able to mock non-virtual methods (if it is not in an interface). But, there's TypeMock who can do this, so it is possible. Can anyone show how to do it? I may even try to contribute to an open source framework if I can get this...

Isolating Dependencies Without Inversion Of Control

I'm working on an enterprise application that relies heavily on message queues, com+, databases, httpcontext, static utility classes etc. Since there's 600 projects in our system it seems impractical to rewrite to use inversion of control. Typemock claims they are the only isolation framework that doesn't require you to rewrite your co...

Where is the [TestMethod] Attribute in TypeMock?

Ok, dumb question. I'm trying to set up my first TypeMock demo project in VS2005 but it doesn't recognize the [TestMethod] attribute. I've included both the TypeMock and TypeMock.ArrangeActAssert assemblies and I'm referencing them with "using" statements. Even intellisense can't find the attribute. What am I doing wrong here? ...

How can I measure the overhead of a mocking framework (TypeMock)?

I'm just beginning to evaluate mocking frameworks for my team and am wondering if anyone has any pointers to reference documentation or experience that you can share regarding the cost of mocking when doing performance tests. Links? Personal experience? Details appreciated. ...

Using TypeMock Isolator.Swap.AllInstances<T> in a Visual Studio Load Test?

I have the following tests setup. [TestClass, Isolated] public class TestClass { public TestClass() { } private TestContext testContextInstance; public TestContext TestContext { get { return testContextInstance; } set { testContextInstance = value; } } [ClassInitialize, Isolated] ...

Is Mocking able to replace functionality wrapped inside a method?

I'm trying to define a way to simulate an case on accessing into a database without accessing... That's probably sounds quite crazy, but it's not. Here is an example about a method i would like to test: public IDevice GetDeviceFromRepository(string name) { IDevice device = null; IDbConnection connection = new Sq...

RhinoMock vs. TypeMock vs. NUnit's Mocking?

I am just starting to do Test Driven Development, and I am wondering the major differences between RhinoMock, TypeMock, and NUnit's built-in mocking? Any information would be greatly appreciated! ...

Partcover and Typemock integration

Hi, I was wondering if someone has some ideas about how to integrate typemock and partcover. We have unit tests which use typemock in our c# sharepoint based application and we would like to run them via partcover and be able to see the coverage details. I have been able to run the typemock tests via partcover, however, partcover is n...

Is Typemock the only framework that can mock a Linq To SQL Table class?

I am trying to setup unit tests for my Linq To SQL code. My code uses the System.Data.Linq.Table class (generated by the designer). Because this class is sealed and the constructor is internal it is completely impervious to unit testing frameworks like Rhino Mocks. (Unless you want to alter you code to use the repository pattern, whic...

Mocking filesystem

Hi, If my unit tests rely on the file system and I need to mock this, what is the best way to go about this? Thanks ...