c# - Moq - Set different parameter in callback method in two different methods -


i have callback method called filter take in function , single string parameter. in code, filter called 2 different times different methods , parameters. there way set parameter different each instance filter called?

private void method1 {     filter(iq1, function1);     }  private void method2 {     filter(iq2, function2); } 

this how tried set mock

private mock<filter> m = new mock<filter>(); string test1 = "hello"; string test2 = "goodbye";  var queue = new queue<string>(); queue.enqueue(test1); queue.enqueue(test2);  m.setup(f => f.filter(it.isnotnull<string>, it.isany<action<filter>>).callback((string iq, action<filter> action) => action(queue.dequeue()); 

i know method1 calls filter before method2.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -