Verify private method was called

20/10/2012 23:53

ClearCache(properties) is private static void function of ContactListReceiverClass

 

//Verify private static method was called

Isolate.Verify.NonPublic.WasCalled(typeof(ContactListReceiverClass),"ClearCache").WithArguments(properties);

 

//In case it's instance function

ContactListReceiverClass target= new ContactListReceiverClass(properties);

Isolate.Verify.NonPublic.WasCalled(target,"ClearCache").WithArguments(properties);

 

//Verify Private method MyCustomMethod of MyComponent class was not called

Isolate.Verify.NonPublic.WasNotCalled(typeof(MyComponent), "MyCustomMethod");