public void CheckCompetitionInformation() { //Create lane var laneId = _system.CreateLane(1); var lane = _system.GetLane(1); //Create match var matchId = _system.CreateMatch(roundList, lane); var match = _system.GetMatch(matchId); //Create time period var timeperiod = new TimePeriod { Starttime = new DateTime(2017, 11, 01), Endtime = new DateTime(2017, 11, 25) }; matchList.Add(match); //Create Competition var competitionId = _system.CreateCompetition("Bästa Tävlingen", timeperiod, matchList); var competition = _system.GetCompetition(competitionId); var matchRounds = _system.GetMatch(matchId).Rounds; Assert.Equal("Bästa Tävlingen", competition.Name); Assert.Equal(3, matchRounds.Count); Assert.Equal(1, competition.Matches.Count); }
public Match CreateMatch(string player1Name, int player1score1, int player1score2, int player1score3, string player2Name, int player2score1, int player2score2, int player2score3, Party winner) { //Create MATCH 1 //Create series var serie1Id = _system.CreateSerie(_system.GetAllParties().First(x => x.Name == player1Name), player1score1); var serie2Id = _system.CreateSerie(_system.GetAllParties().First(x => x.Name == player2Name), player2score1); var serie1 = _system.GetSerie(serie1Id); var serie2 = _system.GetSerie(serie2Id); var serie3Id = _system.CreateSerie(_system.GetAllParties().First(x => x.Name == player1Name), player1score2); var serie4Id = _system.CreateSerie(_system.GetAllParties().First(x => x.Name == player2Name), player2score2); var serie3 = _system.GetSerie(serie3Id); var serie4 = _system.GetSerie(serie4Id); var serie5Id = _system.CreateSerie(_system.GetAllParties().First(x => x.Name == player1Name), player1score3); var serie6Id = _system.CreateSerie(_system.GetAllParties().First(x => x.Name == player2Name), player2score3); var serie5 = _system.GetSerie(serie5Id); var serie6 = _system.GetSerie(serie6Id); //Create lane var laneId = _system.CreateLane(1); var lane = _system.GetLane(1); //Create rounds var round1Id = _system.CreateRound(serie1, serie2); var round2Id = _system.CreateRound(serie3, serie4); var round3Id = _system.CreateRound(serie5, serie6); var round1 = _system.GetRound(round1Id); var round2 = _system.GetRound(round2Id); var round3 = _system.GetRound(round3Id); var roundList = new List <Round>(); roundList.Add(round1); roundList.Add(round2); roundList.Add(round3); //Create match var matchId = _system.CreateMatch(roundList, lane, winner); return(_system.GetMatch(matchId)); }