Exemple #1
0
 public static void AddTeam(Team team)
 {
     if (CheckIfTeamExists(team))
     {
         throw new InvalidOperationException("Team already exists in that league");
     }
 }
Exemple #2
0
        public static void AddTeam(Team team)
        {
            if (CheckIfTeamExists(team))
                throw new InvalidOperationException("Team already exists in this league.");

            teams.Add(team);
        }
Exemple #3
0
 public Match(int id,Team homeTeam,Team awayTeam,Score score)
 {
     this.Id = id;
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.Score = score;
 }
Exemple #4
0
 public Match(Team homeTeam, Team awayTeam, Score score)
 {
     this.checkTeams = this.CheckTeams(homeTeam, awayTeam);
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.Score = score;
 }
 public static void AddTeam(Team team)
 {
     if (CheckIfTeamExists(team))
     {
         throw new InvalidOperationException("Team already exists");
     }
     teams.Add(team);
 }
Exemple #6
0
 public static void AddTeam(Team team)
 {
     if (TeamExists(team))
     {
         throw new InvalidOperationException("This team is already in that league.");
     }
     teams.Add(team);
 }
Exemple #7
0
 public Player(string firstName, string lastName, decimal salary, DateTime dateOfBirth, Team team)
 {
     this.FirstName = firstName;
     this.LastName = lastName;
     this.Salary = salary;
     this.DateOfBirth = dateOfBirth;
     this.Team = team;
 }
        public static void AddTeam(Team team)
        {
            if (TeamExistInLeague(team))
            {
                throw new InvalidOperationException(MsgConstants.TeamAlreadyExists);
            }

            teams.Add(team);
        }
Exemple #9
0
 public static void AddTeam(Team team)
 {
     var existTeam = teams.FirstOrDefault(m => m.Name == team.Name);
     if (existTeam != null)
     {
         throw new OperationCanceledException("Cannot add Team with the same name.");
     }
     teams.Add(team);
 }
        public Match(Team homeTeam, Team awayTeam, Score score, int id)
        {
            if (homeTeam.Name == awayTeam.Name)
            {
                throw new ArgumentException(MsgConstants.TeamsShouldBeDifferent);
            }

            this.HomeTeam = homeTeam;
            this.AwayTeam = awayTeam;
            this.MatchScore = score;
            this.Id = id;
        }
Exemple #11
0
 public Match(int id,Team homTeam,Team awayTeam)
     : this(id,homTeam,awayTeam,null)
 {
 }
Exemple #12
0
 public Player(string firstName, string lastName, decimal salary, DateTime dateOfBirth, Team team)
 {
     this.FirstName   = firstName;
     this.LastName    = lastName;
     this.Salary      = salary;
     this.DateOfBirth = dateOfBirth;
     this.Team        = team;
 }
Exemple #13
0
 public static bool CheckIfTeamExists(Team team)
 {
     return teams.Any(t => t.Name == team.Name);
 }
Exemple #14
0
 private static bool TeamExists(Team team)
 {
     return teams.Any(t => t.Name == team.Name);
 }
 private static bool CheckIfTeamExists(Team team)
 {
     return teams.Any(p => p.Name == team.Name);
 }
Exemple #16
0
 private bool CheckTeams(Team homeTeam, Team awayTeam)
 {
     return homeTeam.Name == awayTeam.Name;
 }
 private static void AddTeam(Team newTeam)
 {
     League.AddTeam(newTeam);
     Console.WriteLine("The {0} has been added successfully", newTeam.Name);
 }
Exemple #18
0
 public Match(Team homeTeam, Team awayTeam)
     : this(homeTeam, awayTeam, null)
 {
 }
Exemple #19
0
 public Match(Team homeTeam, Team awayTeam, Score score)
 {
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.Score = score;
 }