Tuesday, 15 May 2012

c# - How to find out if method was called in a bool value in Rhino mocks? -


I am trying to write a parametric unit test using NUINIT and Rhino Mox which is returning the right or wrong Could. Mast method was called Behavior Called is not correct because this test immediately fails. I just want to have a bool value [test cass (1,2, result = false)] [test sez (1,1, result = true)] public hair some tests (int a, int b) {... SomeObject.CheckValues ​​(A, B); // Log is something if the value is different Return the mock logger. Bill (x => X log (empty)); }

desired the OSC does not exist.

Stub to set the Bull when the log method is pressed on the Mocklogger, and return it :

  bool logMethodWasCalled = false; Mocklogger .Stub (x = & gt; x.log (Arg & lt; string & gt; .Is.Equal (null)). (New Action & lt; string & gt; (_ = & gt; logMethodWasCalled = true) ); // run the test ... call back the log method method;    

No comments:

Post a Comment