Exemplo n.º 1
0
        public void AssignPointsToTravelersTest()
        {
            traveler1.TravelerMove(1);
            traveler2.TravelerMove(1);

            Assert.AreEqual(traveler1.Coins, 3);
            Assert.AreEqual(traveler2.Coins, 3);
        }
Exemplo n.º 2
0
        public void OnlyWinnerTravelerTest()
        {
            traveler1.TravelerMove(1);
            traveler1.TravelerMove(2);
            traveler1.TravelerMove(3);
            traveler1.TravelerMove(4);
            traveler1.TravelerMove(5);

            traveler2.TravelerMove(1);
            traveler2.TravelerMove(3);
            traveler2.TravelerMove(5);
            Traveler winner = roadOne.Final.Winners[0];

            Assert.AreEqual(traveler1.Name, winner.Name);
            Assert.AreEqual(traveler1.Score, traveler1.Score);
            Assert.AreEqual(traveler1.Position, winner.Position);
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            // Experiencias.
            MountainLandscape mountainOne = new MountainLandscape("Los Andes", 2, 1);
            MountainLandscape mountainTwo = new MountainLandscape("Everest", 1, 2);
            OceanLandscape    oceanOne    = new OceanLandscape("Atlantico", 3, 3);
            OceanLandscape    oceanTwo    = new OceanLandscape("Pacifico", 4, 4);
            Farm         farm             = new Farm("La Joaquina", 3, 5, 3);
            ThermalWater dayman           = new ThermalWater("Termas del Dayman,", 4, 6, 3);

            // Viajeros.
            SingleTraveler fran  = new SingleTraveler("Fran");
            SingleTraveler juan  = new SingleTraveler("Juan");
            SingleTraveler pedro = new SingleTraveler("Pedro");

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

            players.Add(fran);
            players.Add(juan);
            players.Add(pedro);
            List <Traveler> winners = new List <Traveler>();

            // El Camino.
            Road road = new Road();

            road.AddExperience(mountainOne);
            road.AddExperience(mountainTwo);
            road.AddExperience(oceanOne);
            road.AddExperience(oceanTwo);
            road.AddExperience(farm);
            road.AddExperience(dayman);

            road.AddTravelers(fran);
            road.AddTravelers(juan);
            road.AddTravelers(pedro);
            road.FinalPositionOfRoad();
            road.LoadObservers();

            // Movimiento de Jugadores.
            fran.TravelerMove(1);
            juan.TravelerMove(2);
            pedro.TravelerMove(1);

            fran.TravelerMove(2);
            juan.TravelerMove(3);
            pedro.TravelerMove(2);


            fran.TravelerMove(5);
            juan.TravelerMove(6);
            pedro.TravelerMove(3);

            fran.TravelerMove(7);
            juan.TravelerMove(7);
            pedro.TravelerMove(4);
            pedro.TravelerMove(5);
            pedro.TravelerMove(6);
            pedro.TravelerMove(7);

            winners = road.Final.Winners;

            // Ganador o Ganadores.
            Console.WriteLine("Los Puntajes Finales son: ");
            foreach (Traveler traveler in players)
            {
                Console.WriteLine($"{traveler.Name}: {traveler.Score}");
            }


            foreach (Traveler traveler in winners)
            {
                Console.WriteLine($"El ganador es {traveler.Name} con {traveler.Score} puntos");
            }
        }
Exemplo n.º 4
0
 public void TravelerMoveTest()
 {
     fran.TravelerMove(1);
     Assert.AreEqual(fran, mountain.Travelers[0]);
     Assert.AreEqual(fran.Position, 1);
 }