コード例 #1
0
        public void TestSetPlayerNameWithEmptyString()
        {
            //Arrange
            Player TestPlayer = new Player();
            string expectedPlayerName = "Player 1";

            //Act
            TestPlayer.SetPlayerName("", 1);
            string actualPlayerName = TestPlayer.GetPlayerName();

            //Assert
            Assert.AreEqual(actualPlayerName, expectedPlayerName);
        }
コード例 #2
0
        public void TestSetAndGetPlayerName_ValidInputs_CorrectResult()
        {
            //Arrange
            Player TestPlayer = new Player();
            string expectedPlayerName = "Mr.Big";

            //Act
            TestPlayer.SetPlayerName("Mr.Big",1);
            string actualPlayerName = TestPlayer.GetPlayerName();

            //Assert
            Assert.IsTrue(actualPlayerName == expectedPlayerName);
        }