public void TestMethod1() { WayStrategy way = new WayStrategy(new Bus()); Assert.AreEqual("4 hours", way.Time()); Assert.AreEqual("200 gold", way.Pay()); }
public void TestMethod2() { WayStrategy way = new WayStrategy(new Car()); Assert.AreEqual("2 hours", way.Time()); Assert.AreEqual("500 gold", way.Pay()); }
public void TestMethod3() { WayStrategy way = new WayStrategy(new Legs()); Assert.AreEqual("Veryyy lonng!!!", way.Time()); Assert.AreEqual("It's freeee!!!!", way.Pay()); }
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(); }