public void PlayWithLastMatchupResultReturnsCorrectCooperationStrategyMatchupResultForStrategyB()
        {
            // Arrange
            var strategyA = new TitForTatCooperationStrategy();
            var strategyB = new TitForTatCooperationStrategy();
            var cooperationChoicePayoff = new CooperationChoicesPayoff();
            var cooperationStrategyMatchup = new CooperationStrategyMatchup(strategyA, strategyB, cooperationChoicePayoff);
            var lastMatchupResult = new CooperationStrategyMatchupResult(
                new CooperationStrategyResult
                    {
                        Strategy = strategyA,
                        ChoiceMade = CooperationChoice.Cooperate,
                        Payoff =
                            cooperationChoicePayoff.Calculate(
                                CooperationChoice.Cooperate, CooperationChoice.Cooperate),
                    },
                new CooperationStrategyResult
                    {
                        Strategy = strategyB,
                        ChoiceMade = CooperationChoice.Cooperate,
                        Payoff =
                            cooperationChoicePayoff.Calculate(
                                CooperationChoice.Cooperate, CooperationChoice.Cooperate),
                    });

            // Act
            var cooperationStrategyMatchupResult = cooperationStrategyMatchup.Play(lastMatchupResult);

            // Assert
            var correctCooperationStrategyResultForStrategyB = new CooperationStrategyResult
                                                                   {
                                                                       Strategy = strategyB,
                                                                       ChoiceMade = CooperationChoice.Cooperate,
                                                                       Payoff = CooperationChoicesPayoff.DefaultPayoffForCooperateAndCooperate
                                                                   };
            Assert.Equal(correctCooperationStrategyResultForStrategyB, cooperationStrategyMatchupResult.StrategyBResult);
        }
        public void PlayWithNullLastMatchupResultThrowsArgumentNullException()
        {
            // Arrange
            var strategyA = new TitForTatCooperationStrategy();
            var strategyB = new TitForTatCooperationStrategy();
            var cooperationChoicePayoff = new CooperationChoicesPayoff();
            var cooperationStrategyMatchup = new CooperationStrategyMatchup(strategyA, strategyB, cooperationChoicePayoff);
            CooperationStrategyMatchupResult nullLastMatchupResult = null;

            // Act

            // Assert
            Assert.Throws<ArgumentNullException>(() => cooperationStrategyMatchup.Play(nullLastMatchupResult));
        }
        public void PlayReturnsCorrectCooperationStrategyMatchupResultForStrategyB()
        {
            // Arrange
            var strategyA = new NaiveCooperationStrategy();
            var strategyB = new EvilCooperationStrategy();
            var cooperationChoicePayoff = new CooperationChoicesPayoff();
            var cooperationStrategyMatchup = new CooperationStrategyMatchup(strategyA, strategyB, cooperationChoicePayoff);

            // Act
            var cooperationStrategyMatchupResult = cooperationStrategyMatchup.Play();

            // Assert
            var correctCooperationStrategyResultForStrategyB = new CooperationStrategyResult
                                                                   {
                                                                       Strategy = strategyB,
                                                                       ChoiceMade = CooperationChoice.Defect,
                                                                       Payoff = CooperationChoicesPayoff.DefaultPayoffForDefectAndCooperate,
                                                                   };
            Assert.Equal(correctCooperationStrategyResultForStrategyB, cooperationStrategyMatchupResult.StrategyBResult);
        }