public void ExecuteSuccessfullyReturnsCorrectResult() { Action<object> testAction = _ => { }; var sut = new FirstClassCommand(testAction, anotherMethod, false); var actual = sut.Execute(new object()); var pr = Assert.IsAssignableFrom<PassedResult>(actual); Assert.Equal(anotherMethod.Name, pr.MethodName); Assert.Equal(anotherMethod.TypeName, pr.TypeName); }
public void ExecuteInvokesAction() { var verified = false; var obj = new object(); Action<object> spy = x => verified = x == obj; var sut = new FirstClassCommand(spy, dummyMethod, false); sut.Execute(obj); Assert.True(verified, "Spy should have been invoked."); }