Beispiel #1
0
        public void Execute_GivenDecoratedCommandHasNoSummary_DoesNotWriteToTextWriter()
        {
            Given_DecoratedCommandHasNoSummary();

            DecoratorCommand.Execute();

            _mockTextWriter.Verify(tw => tw.WriteLine(It.IsAny <string>()), Times.Never);
        }
Beispiel #2
0
        public void Execute_GivenDecoratedCommandHasSummary_WritesSummaryToTextWriter()
        {
            Given_DecoratedCommandHasSummary();

            DecoratorCommand.Execute();

            _mockTextWriter.Verify(tw => tw.WriteLine(It.IsAny <string>()));
        }
Beispiel #3
0
        public void Execute_CreatesNewRewardCommandForEachLapCompleted()
        {
            DecoratorCommand.Execute();

            _mockLapCounter.Verify(l => l.GetLapsCompleted());
            _mockCommandFactory.Verify(
                c => c.CreateFor(It.IsAny <IPlayer>()),
                Times.Exactly((int)_lapsComplete));
        }
Beispiel #4
0
        public void GetSubsequentCommands_GivenDecoratorCommandExecuted_YieldsRewardCommandAndSubsequentCommandsFromDecoratedCommand()
        {
            DecoratorCommand.Execute();

            var commandsResultingFromExecutionOfRewardDecorator = DecoratorCommand.GetSubsequentCommands();

            Assert.That(
                commandsResultingFromExecutionOfRewardDecorator,
                Is.EqualTo(RewardCommands.Concat(AdditionalCommandsProducedByDecoratedCommand)));
        }
Beispiel #5
0
        public void Execute_ResetsLapCounter()
        {
            DecoratorCommand.Execute();

            _mockLapCounter.Verify(l => l.Reset());
        }