public void TestValidateMethod() { Console.WriteLine("Inside " + GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name); bool test = true; RelayEvent control = new RelayEvent("TM1", "TM2", new EventPoints(5.0m, 0.0m, "Athlete1", "TM1", "11.3"), new EventPoints(0.0m, 0.0m, "Athlete2", "TM1", "11.4"), 5.0m, 0.0m); RelayEvent team1PtsDontMatch = new RelayEvent("TM1", "TM2", new EventPoints(5.0m, 0.0m, "Athlete1", "TM1", "11.3"), new EventPoints(0.0m, 0.0m, "Athlete2", "TM1", "11.4"), 4.0m, 0.0m); RelayEvent team2PtsDontMatch = new RelayEvent("TM1", "TM2", new EventPoints(4.0m, 0.0m, "Athlete1", "TM1", "11.3"), new EventPoints(0.0m, 0.0m, "Athlete2", "TM1", "11.4"), 4.0m, 1.0m); RelayEvent totalAbove5 = new RelayEvent("TM1", "TM2", new EventPoints(5.0m, 1.0m, "Athlete1", "TM1", "11.3"), new EventPoints(0.0m, 0.0m, "Athlete2", "TM1", "11.4"), 5.0m, 1.0m); RelayEvent noNameTeam1 = new RelayEvent("", "TM2", new EventPoints(5.0m, 0.0m, "Athlete1", "TM1", "11.3"), new EventPoints(0.0m, 0.0m, "Athlete2", "TM1", "11.4"), 5.0m, 0.0m); RelayEvent noNameTeam2 = new RelayEvent("TM1", "", new EventPoints(5.0m, 0.0m, "Athlete1", "TM1", "11.3"), new EventPoints(0.0m, 0.0m, "Athlete2", "TM1", "11.4"), 5.0m, 0.0m); RelayEvent nullNameTeam1 = new RelayEvent("TM1", "TM2", new EventPoints(0.0m, 0.0m, "", "TM1", "11.3"), new EventPoints(0.0m, 0.0m, "Athlete2", "TM1", "11.4"), 0.0m, 0.0m); RelayEvent nullNameTeam2 = new RelayEvent("TM1", "TM2", new EventPoints(5.0m, 0.0m, "Athlete1", "TM1", "11.3"), new EventPoints(0.0m, 0.0m, "", "TM1", "11.4"), 5.0m, 0.0m); RelayEvent noNameWithPtsTeam1 = new RelayEvent("TM1", "TM2", new EventPoints(5.0m, 0.0m, "", "", "11.3"), new EventPoints(0.0m, 0.0m, "Athlete2", "TM1", "11.4"), 5.0m, 0.0m); RelayEvent nameWithNoPtsTeam1 = new RelayEvent("TM1", "TM2", new EventPoints(0.0m, 0.0m, "Athlete1", "TM1", "11.3"), new EventPoints(0.0m, 0.0m, "Athlete2", "TM1", "11.4"), 0.0m, 0.0m); RelayEvent secondPlaceHasPts = new RelayEvent("TM1", "TM2", new EventPoints(4.0m, 0.0m, "Athlete1", "TM1", "11.3"), new EventPoints(0.0m, 1.0m, "Athlete2", "TM1", "11.4"), 4.0m, 1.0m); if (!control.validate()) { test = false; Console.WriteLine("control was invalid"); } if (team1PtsDontMatch.validate()) { test = false; Console.WriteLine("team1PtsDontMatch was valid"); } if (team2PtsDontMatch.validate()) { test = false; Console.WriteLine("team2PtsDontMatch was valid"); } if (totalAbove5.validate()) { test = false; Console.WriteLine("totalAbove5 was valid"); } if (noNameTeam1.validate()) { test = false; Console.WriteLine("noNameTeam1 was valid"); } if (noNameTeam2.validate()) { test = false; Console.WriteLine("noNameTeam2 was valid"); } if (nullNameTeam1.validate()) { test = false; Console.WriteLine("nullNameTeam1 was valid"); } if (nullNameTeam2.validate()) { test = false; Console.WriteLine("nullNameTeam2 was valid"); } if (noNameWithPtsTeam1.validate()) { test = false; Console.WriteLine("noNameWithPtsTeam1 was valid"); } if (nameWithNoPtsTeam1.validate()) { test = false; Console.WriteLine("nameWithNoPtsTeam1 was valid"); } if (secondPlaceHasPts.validate()) { test = false; Console.WriteLine("secondPlaceHasPts was valid"); } Assert.True(test, GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Failed"); Console.WriteLine(GetType().Name + " - " + System.Reflection.MethodBase.GetCurrentMethod().Name + " Passed"); }