When I run the below test, repos.Delete("Test") does not get called. However, I tried to isolate the repos.Delet(context, selector) method and wanted to check whether that method get's called by repos.Delete("Test"). So in the method repos.Delete("Test"), I instantiate a context and generate a selector wich I pass to repos.Delete(context, selector).
If I comment out the Isolate.WhenCalled method, repos.Delete("Test") get's called. So, the question is, does Isolate method overloading and signature resolution? Or did I just do something wrong??
[Isolated]
[TestMethod]
public void CallDeleteWithContextAndSelectorWhenDeleteByName()
{
var fakeContext = Isolate.Fake.Instance<GenFormDataContext>();
Func<Test> fakeSelector = (x => x.name == "Test");
var repos = new Repository<ITest>(fakeContext);
Isolate.WhenCalled(() => repos.Delete(fakeContext, fakeSelector)).IgnoreCall();
Isolate.NonPublic.WhenCalled(repos, "GetNameSelector").WillReturn(fakeSelector);
repos.Delete("Test");
Isolate.Verify.WasCalledWithAnyArguments(() => repos.Delete(fakeContext, fakeSelector));
}