/// <summary> /// Initializes a new instance of the Match8x4 class. /// </summary> /// <param name="location">Match location.</param> /// <param name="date">Match date.</param> /// <param name="bitsMatchId">BITS match id.</param> /// <param name="homeTeam">Home team.</param> /// <param name="awayTeam">Away team.</param> public Match8x4( string location, DateTimeOffset date, int bitsMatchId, Team8x4 homeTeam, Team8x4 awayTeam) { Location = location; Date = date; BitsMatchId = bitsMatchId; teams = new List<Team8x4> { homeTeam, awayTeam }; }
public static void VerifyTeam(Team8x4 team) { Assert.Equal("Fredrikshof IF", team.Name); Assert.Equal(845, team.PinsForPlayer("Mikael Axelsson")); Assert.Equal(814, team.PinsForPlayer("Hans Norbeck")); Assert.Equal(799, team.PinsForPlayer("Lars Öberg")); Assert.Equal(794, team.PinsForPlayer("Torbjörn Jensen")); Assert.Equal(787, team.PinsForPlayer("Peter Sjöberg")); Assert.Equal(743, team.PinsForPlayer("Kjell Jansson")); Assert.Equal(735, team.PinsForPlayer("Christer Liedholm")); Assert.Equal(540, team.PinsForPlayer("Kjell Persson")); Assert.Equal(159, team.PinsForPlayer("Thomas Gurell")); for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { int result1 = Result8X4[(i * 4) + j][0]; int result2 = Result8X4[(i * 4) + j][1]; Assert.Equal(result1, team.Series.ElementAt(i).Tables.ElementAt(j).Game1.Pins); Assert.Equal(result2, team.Series.ElementAt(i).Tables.ElementAt(j).Game2.Pins); } } Assert.Equal(4, team.Series.Count()); Assert.Equal(6216, team.Pins()); Assert.Equal(1598, team.PinsFor(1)); Assert.Equal(1573, team.PinsFor(2)); Assert.Equal(1505, team.PinsFor(3)); Assert.Equal(1540, team.PinsFor(4)); Assert.Equal(2, team.ScoreFor(1)); Assert.Equal(2, team.ScoreFor(2)); Assert.Equal(1, team.ScoreFor(3)); Assert.Equal(1, team.ScoreFor(4)); Assert.Equal(6, team.Score); }