I am trying to test the following code
public void CleanUp() { List<ITask> tasks = _cleanupTaskFactory.GetTasks();
In my test, I create a mocked implementation of _cleanupTaskFactory, and I want to drown out the GetTasks () method to return a type:
List<Mock<ITask>>
... but the compiler will not accept this as a return value.
My goal is to ensure that every task returned has a .Execute () method called using the Verify () MoQ method.
How can I claim that every task is completed?
unit-testing moq mocking
Steve horn
source share