Ejemplo n.º 1
0
 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());
 }
Ejemplo n.º 2
0
 public void InsertTeam(Team team)
 {
     teams.Add(teamCounter++, team.Clone());
 }
Ejemplo n.º 3
0
 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();
     }
 }