Beispiel #1
0
        public void AssignTie_GivenTieGame()
        {
            var roundResult = new RoundResultBuilder().WithDefaults()
                              .Winner(null).Build();

            var playerSpecific = roundResult.ToPlayerSpecific(_player1);

            playerSpecific.Outcome.Should().Be(RoundOutcome.Tie);
        }
Beispiel #2
0
        public void AssignLoser_GivenLoserAsPlayer()
        {
            var roundResult = new RoundResultBuilder().WithDefaults()
                              .Winner(_player1.Competitor).Build();

            var playerSpecific = roundResult.ToPlayerSpecific(_player2);

            playerSpecific.Outcome.Should().Be(RoundOutcome.Loss);
        }
Beispiel #3
0
        public void AssignPlayerMoveCorrectly_GivenFullScenario()
        {
            var roundResult = new RoundResultBuilder().WithDefaults()
                              .Winner(_player1.Competitor)
                              .Player1(_player1.Competitor).Player1Played(Decision.Dynamite)
                              .Player2(_player2.Competitor).Player2Played(Decision.Paper)
                              .Build();

            var player1Specific = roundResult.ToPlayerSpecific(_player1);
            var player2Specific = roundResult.ToPlayerSpecific(_player2);

            player1Specific.Outcome.Should().Be(RoundOutcome.Win);
            player2Specific.Outcome.Should().Be(RoundOutcome.Loss);

            player1Specific.YourPrevious.Should().Be(Decision.Dynamite);
            player2Specific.OpponentPrevious.Should().Be(Decision.Dynamite);

            player1Specific.OpponentPrevious.Should().Be(Decision.Paper);
            player2Specific.YourPrevious.Should().Be(Decision.Paper);
        }