Пример #1
0
        public static void VerifyTeam(Team4x4 team)
        {
            Assert.Equal("Fredrikshof C", team.Name);
            Assert.Equal(561, team.PinsForPlayer("Tomas Gustavsson"));
            Assert.Equal(598, team.PinsForPlayer("Markus Norbeck"));
            Assert.Equal(717, team.PinsForPlayer("Lars Norbeck"));
            Assert.Equal(594, team.PinsForPlayer("Matz Classon"));
            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    int result = result4x4[(i * 4) + j];

                    Assert.Equal(result, team.Series.ElementAt(i).Games.ElementAt(j).Pins);
                }
            }

            Assert.Equal(4, team.Series.Count());
            Assert.Equal(2470, team.Pins());
            Assert.Equal(623, team.PinsFor(1));
            Assert.Equal(545, team.PinsFor(2));
            Assert.Equal(689, team.PinsFor(3));
            Assert.Equal(613, team.PinsFor(4));
            Assert.Equal(1, team.ScoreFor(1));
            Assert.Equal(1, team.ScoreFor(2));
            Assert.Equal(2, team.ScoreFor(3));
            Assert.Equal(2, team.ScoreFor(4));
            Assert.Equal(6, team.Score);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the Match4x4 class.
 /// </summary>
 /// <param name="location">Match location.</param>
 /// <param name="date">Match date.</param>
 /// <param name="homeTeam">Home team.</param>
 /// <param name="awayTeam">Away team.</param>
 public Match4x4(
     string location,
     DateTimeOffset date,
     Team4x4 homeTeam,
     Team4x4 awayTeam)
 {
     Location = location;
     Date = date;
     teams = new List<Team4x4> { homeTeam, awayTeam };
 }