NUnit and TypeMock
NUnit and TypeMock
I am new to using code coverage and some mocking tools but have done TDD before.
I am trying to increase my code coverage for a class... Now, whilst all the conditions/coverage has been met, when I am using Typemock to mock up a fake instance of a class or interface, even though the Assert passes, as does the Isolate/Verify, the code coverage remains the same!
if I take out the fake stuff, the code coverage shows 100%, problem seems to be when I add the Typemock stuff.
am I doing something wrong or some how not configured ncover correctly to take into consideration the type mock stuff?
code:
[Test, Isolated]
public void DoSomeTest()
{
var myFakeClass = Isolate.Fake.Instance();
Isolate.WhenCalled(() => myFakeClass.AProperty).WillReturn(null);
Assert.AreEqual(null, myFakeClass.AProperty);
Isolate.Verify.WasCalledWithAnyArguments(() => myFakeClass.AProperty);
}
this results in code coverage remaining the same. if I properly instantiate the MyClass instance and set the property a null value, test still passes but code coverage is 100%
any ideas?
RE: NUnit and TypeMock
Can you email a screenshot of what you're seeing to support@ncover.com? You may also want to contact the TypeMock guys, as they may have some insights into how their stuff works under the hood that may be causing the coverage issue.