Ejemplo n.º 1
0
 public void PlayerInfoCompareToWithSecondPlayerBetter()
 {
     BullsAndCows.PlayerInfo firstDemoPlayer = new BullsAndCows.PlayerInfo("Master Nakov", 7);
     BullsAndCows.PlayerInfo secondDemoPlayer = new BullsAndCows.PlayerInfo("Niki", 3);
     int compareResult = firstDemoPlayer.CompareTo(secondDemoPlayer);
     Assert.IsTrue(compareResult > 0);
 }
Ejemplo n.º 2
0
 public void PlayerInfoCompareToWithEqualPlayers()
 {
     BullsAndCows.PlayerInfo firstDemoPlayer = new BullsAndCows.PlayerInfo("Ninja Player", 4);
     BullsAndCows.PlayerInfo secondDemoPlayer = new BullsAndCows.PlayerInfo("Ninja Player", 4);
     int compareResult = firstDemoPlayer.CompareTo(secondDemoPlayer);
     Assert.AreEqual(0, compareResult);
 }
Ejemplo n.º 3
0
 public void PlayerInfoNicknameTest()
 {
     BullsAndCows.PlayerInfo demoPlayer = new BullsAndCows.PlayerInfo("Master Nakov", 1);
     string demoPlayerNickname = demoPlayer.NickName;
     Assert.AreEqual("Master Nakov", demoPlayerNickname);
 }
Ejemplo n.º 4
0
 public void PlayerInfoNullNickname()
 {
     BullsAndCows.PlayerInfo firstDemoPlayer = new BullsAndCows.PlayerInfo("", 7);
 }
Ejemplo n.º 5
0
 public void PlayerInfoToStringTest()
 {
     BullsAndCows.PlayerInfo demoPlayer = new BullsAndCows.PlayerInfo("Master Nakov", 8);
     string expextedToString = string.Format("{0,3}    | {1}", 8, "Master Nakov");
     Assert.AreEqual(expextedToString, demoPlayer.ToString());
 }
Ejemplo n.º 6
0
 public void PlayerInfoGuessesTest()
 {
     BullsAndCows.PlayerInfo demoPlayer = new BullsAndCows.PlayerInfo("Niki", 13);
     int demoPlayerGuesses = demoPlayer.Guesses;
     Assert.AreEqual(13, demoPlayerGuesses);
 }