public void ConstructorTestDataVerify() { TournamentManager.Tournament t = new TournamentManager.Tournament("name", TournamentManager.TEnum.TournamentDyscypline.dodgeball); Assert.AreEqual("name", t.Name); Assert.IsTrue(Enum.IsDefined(typeof(TournamentManager.TEnum.TournamentDyscypline), t.Dyscypline)); }
public void TestAddTeamNoDefined() { TournamentManager.Tournament t = new TournamentManager.Tournament("name", TournamentManager.TEnum.TournamentDyscypline.dodgeball); TournamentManager.TTeam.ITeam teamA = CreateTeam("DodgeBall", "name"); Assert.ThrowsException <TournamentManager.TException.ObjectNotDefined>( () => { t.AddTeam(null); }); }
public void TestAddReferee() { TournamentManager.Tournament t = new TournamentManager.Tournament("name", TournamentManager.TEnum.TournamentDyscypline.dodgeball); TournamentManager.TPerson.Referee refA = (TournamentManager.TPerson.Referee)CreatePerson("Referee", "imei", "nazwisko", 5); try { t.AddReferee((TournamentManager.TPerson.Referee)CreatePerson("Referee", "imei", "nazwisko", 5)); t.AddReferee((TournamentManager.TPerson.Referee)CreatePerson("Referee", "imei", "nazwisko", 5)); t.AddReferee(refA); t.AddReferee((TournamentManager.TPerson.Referee)CreatePerson("Referee", "imei", "nazwisko", 5)); t.AddReferee((TournamentManager.TPerson.Referee)CreatePerson("Referee", "imei", "nazwisko", 5)); } catch (System.Exception ex) { Assert.Fail(ex.Message); } Assert.IsTrue(t.Referees.Contains(refA)); }
public void TestAddTeam() { TournamentManager.Tournament t = new TournamentManager.Tournament("name", TournamentManager.TEnum.TournamentDyscypline.dodgeball); TournamentManager.TTeam.ITeam teamA = CreateTeam("DodgeBall", "name"); try { t.AddTeam(CreateTeam("DodgeBall", "name")); t.AddTeam(CreateTeam("DodgeBall", "name")); t.AddTeam(teamA); t.AddTeam(CreateTeam("DodgeBall", "name")); t.AddTeam(CreateTeam("DodgeBall", "name")); } catch (System.Exception ex) { Assert.Fail(ex.Message); } Assert.IsTrue(t.Teams.Contains(teamA)); }