示例#1
0
        public void Player2_Win_Game_When_Have_Advantage_Score_ShouldBe_Zero_Zero()
        {
            // Arrange
            var service = new TennisService();

            // Act
            Score score = service.Increment(2, (int)GamePoint.Deuce, (int)GamePoint.Advantage);

            // Assert
            Assert.IsNotNull(score);
            score.Player1.PlayerGamePoint.Should().Be(GamePoint.zero);
            score.Player2.PlayerGamePoint.Should().Be(GamePoint.zero);
        }
示例#2
0
        public void Player1_WinPoint_When_Score_Thirty_Thirty_Score_ShouldBe_Fourty_Thirty()
        {
            // Arrange
            var service = new TennisService();

            // Act
            Score score = service.Increment(1, (int)GamePoint.Thirty, (int)GamePoint.Thirty);

            // Assert
            Assert.IsNotNull(score);
            score.Player1.PlayerGamePoint.Should().Be(GamePoint.Forty);
            score.Player2.PlayerGamePoint.Should().Be(GamePoint.Thirty);
        }
示例#3
0
        public void Score_ShouldBe_Deuce_When_Player1_WinPoint_And_Player2_Have_Advantage()
        {
            // Arrange
            var service = new TennisService();

            // Act
            Score score = service.Increment(1, (int)GamePoint.Deuce, (int)GamePoint.Advantage);

            // Assert
            Assert.IsNotNull(score);
            score.Player1.PlayerGamePoint.Should().Be(GamePoint.Deuce);
            score.Player2.PlayerGamePoint.Should().Be(GamePoint.Deuce);
        }
示例#4
0
        public void Start_TheGame_Player1_WinPoint_First_Point_ShouldBe_Fivteen_Zero()
        {
            // Arrange
            var service = new TennisService();

            // Act
            Score score = service.Increment(1, (int)GamePoint.zero, (int)GamePoint.zero);

            // Assert
            Assert.IsNotNull(score);
            score.Player1.PlayerGamePoint.Should().Be(GamePoint.Fifteen);
            score.Player2.PlayerGamePoint.Should().Be(GamePoint.zero);
        }
示例#5
0
        public void Player2_Take_Advantage_When_Score_Forty_Forty_Score_ShouldBe_None_Advantage()
        {
            // Arrange
            var service = new TennisService();

            // Act
            Score score = service.Increment(2, (int)GamePoint.Forty, (int)GamePoint.Forty);

            // Assert
            Assert.IsNotNull(score);
            score.Player1.PlayerGamePoint.Should().Be(GamePoint.Deuce);
            score.Player2.PlayerGamePoint.Should().Be(GamePoint.Advantage);
        }
示例#6
0
        public void Player2_Win_Game_When_Score_thirty_Forty_Score_ShouldBe_Zero_Zero()
        {
            // Arrange
            var service = new TennisService();

            // Act
            Score score = service.Increment(2, (int)GamePoint.Thirty, (int)GamePoint.Forty);

            // Assert
            Assert.IsNotNull(score);
            score.Player1.PlayerGamePoint.Should().Be(GamePoint.zero);
            score.Player2.PlayerGamePoint.Should().Be(GamePoint.zero);
        }
示例#7
0
        public void Player2_WinPoint_When_Score_Fivteen_zero__Score_ShouldBe_Fivteen_Fivteen()
        {
            // Arrange
            var service = new TennisService();

            // Act
            Score score = service.Increment(2, (int)GamePoint.Fifteen, (int)GamePoint.zero);

            // Assert
            Assert.IsNotNull(score);
            score.Player1.PlayerGamePoint.Should().Be(GamePoint.Fifteen);
            score.Player2.PlayerGamePoint.Should().Be(GamePoint.Fifteen);
        }