Ejemplo n.º 1
0
        public void TestMethod1()
        {
            WayStrategy way = new WayStrategy(new Bus());

            Assert.AreEqual("4 hours", way.Time());
            Assert.AreEqual("200 gold", way.Pay());
        }
Ejemplo n.º 2
0
        public void TestMethod2()
        {
            WayStrategy way = new WayStrategy(new Car());

            Assert.AreEqual("2 hours", way.Time());
            Assert.AreEqual("500 gold", way.Pay());
        }
Ejemplo n.º 3
0
        public void TestMethod3()
        {
            WayStrategy way = new WayStrategy(new Legs());

            Assert.AreEqual("Veryyy lonng!!!", way.Time());
            Assert.AreEqual("It's freeee!!!!", way.Pay());
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            //Console.WriteLine("Input your chois: ");
            foreach (var item in new List <IMeans> {
                new Car(), new Legs(), new Bus()
            })
            {
                means = item;
                var way = new WayStrategy(means);
                Console.WriteLine(way.Time());
                Console.WriteLine(way.Pay());
            }

            Console.ReadLine();
        }