Exemplo n.º 1
0
 public void Should_Two_CompetingKingDomAfterTieAndRefresh()
 {
     //when
     SetUpForTie();
     ballotSystem.ReElectionSetup();
     //then
     Assert.AreEqual(2, ballotSystem.CompetingKingdomCount());
 }
Exemplo n.º 2
0
        public void Should_True_ReElectionRequiredIfOneKingdomCompetingAndGotZeroAllies()
        {
            ballotSystem = new BallotSystem(new List <Kingdom>()
            {
                kingdoms[0]
            }, kingdoms);
            ballotSystem.AddMessageToBallot(competing[0], kingdoms[3], "xxxxx");
            ballotSystem.SendMessageToKingdom();

            Assert.IsTrue(ballotSystem.IsReElectionRequired());

            ballotSystem.ReElectionSetup();
            ballotSystem.AddMessageToBallot(competing[0], kingdoms[3], "Owl");
            ballotSystem.SendMessageToKingdom();
            Assert.AreEqual(competing[0], ballotSystem.GetKingdomWithMaxAllies());
            Assert.AreEqual(1, ballotSystem.GetKingdomWithMaxAllies().GetAlliesCount());
        }