示例#1
0
        public void Execute_GivenDecoratedCommandHasNoSummary_DoesNotWriteToTextWriter()
        {
            Given_DecoratedCommandHasNoSummary();

            DecoratorCommand.Execute();

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

            DecoratorCommand.Execute();

            _mockTextWriter.Verify(tw => tw.WriteLine(It.IsAny <string>()));
        }
示例#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));
        }
示例#4
0
        public void GetSubsequentCommands_GivenDecoratorCommandExecuted_YieldsRewardCommandAndSubsequentCommandsFromDecoratedCommand()
        {
            DecoratorCommand.Execute();

            var commandsResultingFromExecutionOfRewardDecorator = DecoratorCommand.GetSubsequentCommands();

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

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