NMock2 question

    Date: 11/18/09 (C Sharp)    Keywords: no keywords

    Is it possible in NMock2 to expect one of two different methods, A() or B(), on a mock to be called?

    If there was a way to check how many times a given method had already been called, I could just

    Expect.Once.On.(myMock).Method("A");
    Expect.Once.On.(myMock).Method("B");
    test(myMock);

    ..and then test to see if one of them had been called and forcibly call the other so the expectations would be met. Ugly but good enough, but I don't think NMock2 mocks expose any interface that allows that the number of calls to be tested?

    Source: http://csharp.livejournal.com/105589.html

« My open source project || Writing namespace to an XML... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home