public void Test_Travel() { { Client client = new Client(1000); AutoTravelStrategy strategy = new AutoTravelStrategy(client); strategy.ToTheAirport(); Assert.That(client.Money, Is.EqualTo(800)); } { Client client = new Client(1000); BusTravelStrategy strategy = new BusTravelStrategy(client); strategy.ToTheAirport(); Assert.That(client.Money, Is.EqualTo(700)); } { Client client = new Client(1000); TaxiTravelStrategy strategy = new TaxiTravelStrategy(client); strategy.ToTheAirport(); Assert.That(client.Money, Is.EqualTo(750)); } { Client client = new Client(1000); TrainTravelStrategy strategy = new TrainTravelStrategy(client); strategy.ToTheAirport(); Assert.That(client.Money, Is.EqualTo(650)); } }
public void TaxiTravel_ShouldReturn_StringSayingModeAndCost() { ITravelStrategy bus = new TaxiTravelStrategy(); Assert.Equal("Traveler is going to Airport by Taxi and will be charged Rs 1000", bus.GotoAirport()); }