public void TestNoFileExists() { // 1. Arrange: if (File.Exists("ProgressLog.txt")) { File.Delete("ProgressLog.txt"); } DataReader reader = new DataReader(); // 2. Act: reader.Winning(Global.PLAYER1); // 3. Assert: Assert.IsTrue(File.Exists(reader.path)); }
public void TestPlayer2Win() { // 1. Arrange: DataReader reader = new DataReader(); int player1 = Global.PLAYER1WIN; int player2 = Global.PLAYER2WIN; int ties = Global.TIENUMBER; // 2. Act: reader.Winning(Global.PLAYER2); // 3. Assert: Assert.AreEqual(player1, Global.PLAYER1WIN); Assert.AreEqual(player2 + 1, Global.PLAYER2WIN); Assert.AreEqual(ties, Global.TIENUMBER); }