Beispiel #1
0
        public void Traveler_ScoreOverflow()
        {
            Traveler traveler = new Traveler();

            traveler.AddScore(int.MaxValue);
            traveler.AddScore(1);

            Assert.AreEqual(traveler.Score, int.MaxValue);
        }
Beispiel #2
0
        public void AddScore_Score_UpdatedScore()
        {
            Traveler traveler = new Traveler();

            traveler.AddScore(10);
            traveler.AddScore(10);
            int result = 20;

            Assert.AreEqual(traveler.Score, result);
        }
Beispiel #3
0
        public void SelectWinners_ListOfTravelers_ListOfWinners()
        {
            Traveler traveler1 = new Traveler();
            Traveler traveler2 = new Traveler();
            Traveler traveler3 = new Traveler();

            traveler1.AddScore(40);
            traveler2.AddScore(20);
            traveler3.AddScore(40);

            List <Traveler> travelers = new List <Traveler>();

            travelers.Add(traveler1);
            travelers.Add(traveler2);
            travelers.Add(traveler3);

            Winners winners = new Winners(travelers);

            List <Traveler> correctResult = new List <Traveler>();

            correctResult.Add(traveler1);
            correctResult.Add(traveler3);

            Assert.AreEqual(winners.ListOfWinners, correctResult);
        }
Beispiel #4
0
        public void RemoveScore_Score_UpdatedScore()
        {
            Traveler travelerOne = new Traveler();

            travelerOne.AddScore(10);
            travelerOne.RemoveScore(5);
            int resultOne = 5;

            Assert.AreEqual(travelerOne.Score, resultOne);
        }
Beispiel #5
0
 public override void Host(Traveler player)
 {
     player.AddScore(2);
 }