public void Execute_GivenDecoratedCommandHasNoSummary_DoesNotWriteToTextWriter() { Given_DecoratedCommandHasNoSummary(); DecoratorCommand.Execute(); _mockTextWriter.Verify(tw => tw.WriteLine(It.IsAny <string>()), Times.Never); }
public void Execute_GivenDecoratedCommandHasSummary_WritesSummaryToTextWriter() { Given_DecoratedCommandHasSummary(); DecoratorCommand.Execute(); _mockTextWriter.Verify(tw => tw.WriteLine(It.IsAny <string>())); }
public void Execute_CreatesNewRewardCommandForEachLapCompleted() { DecoratorCommand.Execute(); _mockLapCounter.Verify(l => l.GetLapsCompleted()); _mockCommandFactory.Verify( c => c.CreateFor(It.IsAny <IPlayer>()), Times.Exactly((int)_lapsComplete)); }
public void GetSubsequentCommands_GivenDecoratorCommandExecuted_YieldsRewardCommandAndSubsequentCommandsFromDecoratedCommand() { DecoratorCommand.Execute(); var commandsResultingFromExecutionOfRewardDecorator = DecoratorCommand.GetSubsequentCommands(); Assert.That( commandsResultingFromExecutionOfRewardDecorator, Is.EqualTo(RewardCommands.Concat(AdditionalCommandsProducedByDecoratedCommand))); }
public void Execute_ResetsLapCounter() { DecoratorCommand.Execute(); _mockLapCounter.Verify(l => l.Reset()); }