chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
WasCalledWithAnyArguments is not working with nunit 2.5 beta and testdriven.net 2.18.

Here's the production code:
    public class MyController
    {


        public void DoNothing()
        {
            
        }
    }


Here's the test code:
       [Test, Isolated]
        public void MyControllerTest()
        {
            MyController controller = Isolate.Fake.Instance<MyController>(Members.ReturnRecursiveFakes);
            Isolate.Verify.WasCalledWithAnyArguments(()=>controller. DoNothing());

        }


Here's the exception trace:
TestCase 'MyControllerTest'
not executed: TypeMock.VerifyException : 
TypeMock Verification: Method DllSendApppTest.Controllers.MyController.DoNothing() was expected but was not called
   at e0.b(ag A_0, b8 A_1)
   at e0.d(Delegate A_0)
   at e0.b(Action A_0)
   C:\development\ReleaseScript\InstantDllUpdate\Source\DllSendApppTest\Controllers\AnotherTest.cs(132,0): at DllSendApppTest.Controllers.AnotherTest.MyControllerTest()
   at TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Object[] A_5)
   at TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected)
   C:\development\ReleaseScript\InstantDllUpdate\Source\DllSendApppTest\Controllers\AnotherTest.cs(0,0): at DllSendApppTest.Controllers.AnotherTest.MyControllerTest()


0 passed, 0 failed, 1 skipped, took 1.86 seconds.


This should be a failed, not skipped.
________
NEW JERSEY MARIJUANA DISPENSARY
asked by nsoonhui (59.1k points)

4 Answers

0 votes
Hi Soon Hui,

This is interesting. I didn't think we affected test frameworks like that :)
Do you get the same result running with NUnit runner? I'm trying to eliminate possible suspects.

We'll check this and get back to you.

Thanks,
answered by gilz (14.5k points)
0 votes
Hi Soon Hui,

This is interesting. I didn't think we affected test frameworks like that :)
Do you get the same result running with NUnit runner? I'm trying to eliminate possible suspects.

We'll check this and get back to you.

Thanks,


This problem only occurs with TestDriven.net. If I run the test in NUnit runner then there is no such problem.

I tried this test on other PC with the same NUnit 2.5 and TestDriven.net 2.18 and I could reproduce this problem.
________
The Cigar Boss
answered by nsoonhui (59.1k points)
0 votes
I got this problem when I was using TestDriven.Net 2.182268 personal, but version 2.18.2294 doesn't have this problem.
________
PENNY STOCKS
answered by nsoonhui (59.1k points)
0 votes
This bug has been fixed in the latest build. I'm waiting for NUnit 2.5 Beta 2 before releasing the next version.

If you drop me an email using the following link I'll send you an interim build:
http://www.testdriven.net/contact.aspx

Regards,
Jamie.

--
http://www.testdriven.net
http://weblogs.asp.net/nunitaddin
answered by jcansdale (140 points)
...