public void runnersShouldMoveIfOutIsNotLastPlayType() { OutRule rule = new OutRule(); List <IPlayerDetails> allPlayers = new List <IPlayerDetails>(); allPlayers.Add(new PlayerDetails("P1") { position = 0 }); allPlayers.Add(new PlayerDetails("P2") { position = 1 }); allPlayers.Add(new PlayerDetails("P3") { position = 3 }); rule.process(allPlayers, false); IPlayerDetails playerOnHomePlate = allPlayers.Find(x => x.playerId == "P1"); Assert.IsTrue(playerOnHomePlate.position == 0); Assert.IsFalse(playerOnHomePlate.scoredRun); Assert.IsTrue(playerOnHomePlate.totalOuts == 1); IPlayerDetails player2Details = allPlayers.Find(x => x.playerId == "P2"); Assert.IsTrue(player2Details.position == 2); Assert.IsFalse(player2Details.scoredRun); IPlayerDetails player3Details = allPlayers.Find(x => x.playerId == "P3"); Assert.IsTrue(player3Details.scoredRun); }
public void ruleShouldBeConfiguredCorrectly() { OutRule rule = new OutRule(); Assert.IsTrue(rule.playType == InningsConstants.OUT); Assert.IsTrue(rule.playType == "out"); }