public void RoundPair_6players_EasyPairInvalid() { List<Player> players = Get6PlayerPool(); List<Match> matches = new List<Match>() { new Match(players[2], players[5]), new Match(players[0], players[3]), new Match(players[4], players[1]), new Match(players[2], players[0]), new Match(players[4], players[3]), new Match(players[5], players[1]) }; matches[0].Score = new List<int>() { 2, 0 }; matches[1].Score = new List<int>() { 2, 0 }; matches[2].Score = new List<int>() { 2, 0 }; matches[3].Score = new List<int>() { 2, 0 }; matches[4].Score = new List<int>() { 0, 2 }; matches[5].Score = new List<int>() { 2, 0 }; var round = new Round(); round.RoundPair(matches, players); Assert.IsTrue(round.Matches.Any(m => m.Players.Contains(players[2]) && m.Players.Contains(players[4]))); Assert.IsTrue(round.Matches.Any(m => m.Players.Contains(players[0]) && m.Players.Contains(players[5]))); Assert.IsTrue(round.Matches.Any(m => m.Players.Contains(players[1]) && m.Players.Contains(players[3]))); }
public void IsReported_NoMatchesReported_False() { var round = new Round(); round.Matches.Add(new Match(new Player("asd"), new Player("ds"))); round.Matches.Add(new Match(new Player("asd"), new Player("ds"))); round.Matches.Add(new Match(new Player("asd"), new Player("ds"))); Assert.IsFalse(round.IsRoundReported()); }
public void IsReported_AllMatchesReported_True() { var round = new Round(); round.Matches.Add(new Match(new Player("asd"), new Player("ds"))); round.Matches.Add(new Match(new Player("asd"), new Player("ds"))); round.Matches.Add(new Match(new Player("asd"), new Player("ds"))); round.Matches[0].Reported = true; round.Matches[1].Reported = true; round.Matches[2].Reported = true; Assert.IsTrue(round.IsRoundReported()); }
public ManualParingWindow(Round piRound) { Round = piRound; DataContext = Round; InitializeComponent(); }
public void RoundPair_8Players_NoDraw() { List<Player> players = Get8PlayerPool(); var matches = new List<Match>() { new Match(players[0], players[1]), new Match(players[2], players[3]), new Match(players[4], players[5]), new Match(players[6], players[7]), new Match(players[0], players[2]), new Match(players[4], players[6]), new Match(players[1], players[3]), new Match(players[5], players[7]), }; matches[0].Score = new List<int>() { 2, 0 }; matches[1].Score = new List<int>() { 2, 0 }; matches[2].Score = new List<int>() { 2, 0 }; matches[3].Score = new List<int>() { 2, 0 }; matches[4].Score = new List<int>() { 2, 0 }; matches[5].Score = new List<int>() { 2, 0 }; matches[6].Score = new List<int>() { 2, 0 }; matches[7].Score = new List<int>() { 2, 0 }; var round = new Round(); round.RoundPair(matches, players); Assert.IsTrue(round.Matches.Any(m => m.Players.Contains(players[0]) && m.Players.Contains(players[4]))); Assert.IsTrue(round.Matches.Any(m => m.Players.Contains(players[3]) && m.Players.Contains(players[7]))); }