public void CreatePlayerTest() { var p = new Player("fn", "ln", 1); Assert.AreEqual("fn", p.FirstName); Assert.AreEqual("ln", p.LastName); Assert.AreEqual(1, p.Number); }
public void SetTeamRosters() { ScorecardFiller filler = new ScorecardFiller(); Player[] homePlayers = new Player[] {new Player("SetterF", "SetterL", 1),new Player("Receiver1F", "Receiver1L",2), new Player("Receiver2F", "Receiver2L", 3), new Player ("Blocker1F", "Blocke1L", 4), new Player("Blocker2F", "Blocker2L", 5), new Player("SpikerF", "SpikerL", 6), new Player("LiberoF", "LiberoL", 7)}; Player[] guestPlayers = new Player[] {new Player("SetterFg", "SetterLg", 1),new Player("Receiver1Fg", "Receiver1Lg",2), new Player("Receiver2Fg", "Receiver2Lg", 3), new Player ("Blocker1Fg", "Blocke1Lg", 4), new Player("Blocker2Fg", "Blocker2Lg", 5), new Player("SpikerFg", "SpikerLg", 6), new Player("LiberoFg", "LiberoLg", 7)}; filler.SetTeams("Home Team", "HoTe", "HoT C", "", "", homePlayers, "Guest Team", "GuTe", "GuT C", "", "", guestPlayers ); }
public void ExchangeTest() { Player p1 = new Player("fn1", "ln1", 1); Player p2 = new Player("fn2", "ln2", 2); var exc = new PlayerExchange(p1, p2, 12, 24); Assert.AreEqual(p1, exc.PlayerOut); Assert.AreEqual(p2, exc.PlayerIn); Assert.AreEqual(12, exc.HomePoints); Assert.AreEqual(24, exc.GuestPoints); }
internal void SetPlayers(Player[] players) { if (players.Length < 6) { throw new ArgumentException("Too few players in team"); } if (players.Length > 12) { throw new ArgumentException("Too many players in team"); } foreach (Player item in players) { this.Players.Add(item); } }
public void PlayOneSetWithSubstitutions() { ScorecardFiller filler = new ScorecardFiller(); Player[] homePlayers = new Player[] {new Player("SetterF", "SetterL", 1),new Player("Receiver1F", "Receiver1L",2), new Player("Receiver2F", "Receiver2L", 3), new Player ("Blocker1F", "Blocke1L", 4), new Player("Blocker2F", "Blocker2L", 5), new Player("SpikerF", "SpikerL", 6), new Player("LiberoF", "LiberoL", 7)}; Player[] guestPlayers = new Player[] {new Player("SetterFg", "SetterLg", 1),new Player("Receiver1Fg", "Receiver1Lg",2), new Player("Receiver2Fg", "Receiver2Lg", 3), new Player ("Blocker1Fg", "Blocke1Lg", 4), new Player("Blocker2Fg", "Blocker2Lg", 5), new Player("SpikerFg", "SpikerLg", 6), new Player("LiberoFg", "LiberoLg", 7)}; filler.SetTeams("Home Team", "HoTe", "HoT C", "", "", homePlayers, "Guest Team", "GuTe", "GuT C", "", "", guestPlayers); filler.SetHomeTeamCaptain(1); filler.SetGuestTeamCaptain(5); filler.SetStartingTeam(Teams.Home); // Start 1st set filler.SetHomeLineup(1, filler.VolleyballMatch.HomeTeam.Players[0], filler.VolleyballMatch.HomeTeam.Players[1], filler.VolleyballMatch.HomeTeam.Players[2], filler.VolleyballMatch.HomeTeam.Players[3], filler.VolleyballMatch.HomeTeam.Players[4], filler.VolleyballMatch.HomeTeam.Players[5]); //now can be either timeouts, exchanges, points or warnings/other penalties filler.AddPoint(Teams.Home); }
public void SetTeamRosters() { ScorecardFiller filler = new ScorecardFiller(); Player[] homePlayers = new Player[] {new Player("SetterF", "SetterL", 1),new Player("Receiver1F", "Receiver1L",2), new Player("Receiver2F", "Receiver2L", 3), new Player ("Blocker1F", "Blocke1L", 4), new Player("Blocker2F", "Blocker2L", 5), new Player("SpikerF", "SpikerL", 6), new Player("LiberoF", "LiberoL", 7)}; Player[] guestPlayers = new Player[] {new Player("SetterFg", "SetterLg", 1),new Player("Receiver1Fg", "Receiver1Lg",2), new Player("Receiver2Fg", "Receiver2Lg", 3), new Player ("Blocker1Fg", "Blocke1Lg", 4), new Player("Blocker2Fg", "Blocker2Lg", 5), new Player("SpikerFg", "SpikerLg", 6), new Player("LiberoFg", "LiberoLg", 7)}; filler.SetTeams("Home Team", "HoTe", "HoT C", "", "", homePlayers, "Guest Team", "GuTe", "GuT C", "", "", guestPlayers); filler.SetHomeTeamCaptain(1); filler.SetGuestTeamCaptain(5); Assert.AreEqual("Home Team", filler.VolleyballMatch.HomeTeam.Name); Assert.AreEqual("GuTe", filler.VolleyballMatch.GuestTeam.Abbreviation); filler.SetHomeLineup(1, filler.VolleyballMatch.HomeTeam.Players[0], filler.VolleyballMatch.HomeTeam.Players[1], filler.VolleyballMatch.HomeTeam.Players[2], filler.VolleyballMatch.HomeTeam.Players[3], filler.VolleyballMatch.HomeTeam.Players[4], filler.VolleyballMatch.HomeTeam.Players[5]); Assert.IsTrue(filler.CheckAllPrematchActionsCompleted()); Assert.AreEqual(1, filler.CurrentSet); }
public void SetHomeLineup(int set, Player player1, Player player2, Player player3, Player player4, Player player5, Player player6) { this.VolleyballMatch.SetsOfTheMatch.Add(new VolleyballSet()); this.VolleyballMatch.SetsOfTheMatch[set - 1].HomeLineup = new Player[] { player1, player2, player3, player4, player5, player6 }; }
public void SetTeams(string homeTeamName, string homeTeamAbbreviation, string homeCoach, string homeAssistantCoach, string v5, Player[] homePlayers, string guestTeamName, string guestTeamAbbreviation, string guestCoach, string guestAssistantCoach, string v10, Player[] guestPlayers) { Team home = new Team(homeTeamName, homeTeamAbbreviation); home.SetCoach(homeCoach); home.SetAssistantCoach(homeAssistantCoach); home.SetPlayers(homePlayers); Team guest = new Team(guestTeamName, guestTeamAbbreviation); guest.SetCoach(guestCoach); guest.SetAssistantCoach(guestAssistantCoach); guest.SetPlayers(guestPlayers); this.VolleyballMatch = new VolleyballMatch(home, guest); this.CurrentSet = 1; }