public void TeamCloneTest() { var players = new List<int>(); foreach (var player in GetPlayers()) { players.Add(player.Key); } var team = new Team("WildCats", "4545454", players); Assert.AreNotSame(team, team.Clone()); }
public void InsertTeam(Team team) { teams.Add(teamCounter++, team.Clone()); }
public void InsertTeam(Team team) { var teamID = teamCounter++; team.SetTeamID(teamID); teams.Add(teamID, team.Clone()); var queries = new List<string>(); queries.Add(SqlQueries.InsertTeam(teamID, team.GetTeamName(), team.GetTeamContact())); foreach (var playerID in team.GetPlayerIDs()) { queries.Add(SqlQueries.InsertPlayerTeam(teamID, playerID)); } foreach (var query in queries) { var command = new SQLiteCommand(query, dbConnection); command.ExecuteNonQuery(); } }