private List <string> PlayTournament(List <List <List <List <string> > > > game) { var winnersOfBrackets = new List <List <string> >(); foreach (var bracket in game) { winnersOfBrackets.Add(_engineBracketGame.PlayBracket(bracket)); } if (winnersOfBrackets.Count > 1) { var newBracket = _engineBracketGame.MakeNewBracket(winnersOfBrackets); return(_engineBracketGame.PlayBracket(newBracket)); } return(winnersOfBrackets[0]); }
public void Test_Make_New_Bracket() { var actual = _rpsBracketGame.MakeNewBracket(new List <List <string> > { Players.PLAYER_1, Players.PLAYER_2, Players.PLAYER_3, Players.PLAYER_4 }); actual.Should().BeEquivalentTo(new List <List <List <string> > > { new List <List <string> > { Players.PLAYER_1, Players.PLAYER_2 }, new List <List <string> > { Players.PLAYER_3, Players.PLAYER_4 } }); }