public void AddTwoTeamsWithSameIdentifierToMatch_ThrowsArgumentException() { var teamIdentifier = new EloTeamIdentifier(); var team1 = new EloTeam(teamIdentifier, new EloPlayer(1200), true); var team2 = new EloTeam(teamIdentifier, new EloPlayer(1350), false); Assert.Throws <ArgumentException>(() => new EloMatch(new[] { team1, team2 })); }
public void AddSamePlayerToSameTeamTwice_ThrowsInvalidOperationException() { var playerIdentifier = new EloPlayerIdentifier(); var player = new EloPlayer(playerIdentifier, 1350); var team = new EloTeam(player, true); Assert.Throws <InvalidOperationException>(() => team.AddPlayer(player)); }
public void TwoTeamsWithSamePlayers_AssertEquality() { var playerIdentifier = new EloPlayerIdentifier(); var rating = new EloRating(1200); var player1 = new EloPlayer(playerIdentifier, rating); var player2 = new EloPlayer(playerIdentifier, rating); var teamIdentifier = new EloTeamIdentifier(); var team1 = new EloTeam(teamIdentifier, player1, true); var team2 = new EloTeam(teamIdentifier, player2, false); Assert.AreEqual(team1, team2); Assert.IsTrue(team1 == team2); Assert.IsTrue(team1.Equals(team2)); }