Given the following class, how can I test that when MethodUnderTest
is called, GetSomething
is invoked?
public class SystemUnderTest
{
private Foo foo;
public string MethodUnderTest(int input)
{
return foo.Get(x => x.GetSomething(input));
}
}
Test
public void VerifyGetSomethingInvokedWhenMethodUnderTestIsInvoked()
{
//Arrange
var sut = new SystemUnderTest();
//Act
string unusedResult = sut.MethodUnderTest(5);
//Assert
A.CallTo(()=> sut.MethodUnderTest(A<int>.Ignored)) //Cant figure out how to test the Func<T> invocation
}