コード例 #1
0
        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));
        }
コード例 #2
0
        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);
            });
        }
コード例 #3
0
 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));
 }
コード例 #4
0
 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));
 }