public override IList <IBasket> CreateInitialBasket() { var output = new List <IBasket>(); for (var i = 1; i <= this.teams.Count / 6; i++) { // TODO tohle jde urcite lip, ale tohle je ted dostatecny var teamOrder = new Dictionary <int, ITeam> { { 1, this.teams[(i - 1) * 6] }, { 2, this.teams[((i - 1) * 6) + 1] }, { 3, this.teams[((i - 1) * 6) + 2] }, { 4, this.teams[((i - 1) * 6) + 3] }, { 5, this.teams[((i - 1) * 6) + 4] }, { 6, this.teams[((i - 1) * 6) + 5] }, }; var currentBasket = new Basket145( i.ToString(), i, 1 ); currentBasket.AddTeams(teamOrder); output.Add( currentBasket ); } return(output); }
public override IList<IBasket> CreateInitialBasket() { var output = new List<IBasket>(); for (var i = 1; i <= this.teams.Count / 6; i++) { // TODO tohle jde urcite lip, ale tohle je ted dostatecny var teamOrder = new Dictionary<int, ITeam> { { 1, this.teams[(i - 1) * 6] }, { 2, this.teams[((i - 1) * 6) + 1] }, { 3, this.teams[((i - 1) * 6) + 2] }, { 4, this.teams[((i - 1) * 6) + 3] }, { 5, this.teams[((i - 1) * 6) + 4] }, { 6, this.teams[((i - 1) * 6) + 5] }, }; var currentBasket = new Basket145( i.ToString(), i, 1 ); currentBasket.AddTeams(teamOrder); output.Add( currentBasket ); } return output; }
public void Basket145Test() { var team1 = new Team("Team1", x => 1); var team2 = new Team("Team2", x => 2); var team3 = new Team("Team3", x => 3); var team4 = new Team("Team4", x => 4); var team5 = new Team("Team5", x => 5); var team6 = new Team("Team6", x => 6); var basket = new Basket145( "Test", 1, 1 ); basket.AddTeam(1, team1); basket.AddTeams( new Dictionary <int, ITeam> { { 2, team2 }, { 3, team3 }, { 4, team4 }, { 5, team5 }, { 6, team6 } } ); Assert.AreEqual(1, basket.Order); Assert.AreEqual(1, basket.Round); Assert.AreEqual("Test", basket.Name); Assert.AreEqual(9, basket.GetBasketeMatches().Count()); var basketResult = basket.GetBasketResult(); // tohle poradi by melo byt t6, t4, t5, t3, t2, t1 Assert.AreEqual(team6, basketResult[1]); Assert.AreEqual(team5, basketResult[2]); Assert.AreEqual(team4, basketResult[3]); Assert.AreEqual(team3, basketResult[4]); Assert.AreEqual(team2, basketResult[5]); Assert.AreEqual(team1, basketResult[6]); }