public void ShouldExecuteCommand() { //Act something.DoSomething(); //Assert command.Received().Execute(); // received AT LEAST ONCE - and possibly N times! command.Received(1).Execute(); // received ONCE ONLY - important distinction! }
public void Test_CheckReceivedCalls_CallReceived() { var command = Substitute.For <ICommand>(); var something = new SomethingThatNeedsACommand(command); something.DoSomething(); command.Received().Execute(); }
public void TestNSubstituteForEvents() { //Arrange var command = Substitute.For <ICommand>(); var something = new SomethingThatNeedsACommand(command); //Act something.DoSomething(); //Assert command.Received().Execute(); }
public void ICommand_Execute_CheckReceiveCall() { //Arrange var command = Substitute.For <ICommand>(); var something = new SomethingThatNeedsACommand(command); //Act something.DoSomething(); //Assert command.Received().Execute(); }
public void Test_CheckReceivedCalls_CallReceived() { //檢查接收到的呼叫 //Arrange var command = Substitute.For <ICommand>(); var something = new SomethingThatNeedsACommand(command); //Act something.DoSomething(); //Assert command.Received(1).Execute(); }