public void Discount10Pct_WhenGroupOfSixOrMoreBooksReturnFlight(int amountOfTravelers, bool isReturnFlightBooked, double expectedDiscountPercentage) { var sut = new AirTravelCalculator(); var actualDiscountPercentage = sut.CalculateDiscount(amountOfTravelers, isReturnFlightBooked); Assert.Equal(expectedDiscountPercentage, actualDiscountPercentage); }
public void Discount5Pct_WhenGreaterThanFiveTravelers(int amountOfTravelers, double expectedDiscountPercentage) { var sut = new AirTravelCalculator(); var actualDiscountPercentage = sut.CalculateDiscount(amountOfTravelers); Assert.Equal(expectedDiscountPercentage, actualDiscountPercentage); }
public void NoDiscount_WhenSinglePersonBooksFlight(int amountOfTravelers, double expectedDiscountPercentage) { var sut = new AirTravelCalculator(); var actualDiscountPercentage = sut.CalculateDiscount(amountOfTravelers); Assert.Equal(expectedDiscountPercentage, actualDiscountPercentage); }
void CalculateFlightPriceTest(int amountOfTravelers, double expectedPrice, bool isReturnFlightIncluded, bool requestingExtraLuggage) { var sut = new AirTravelCalculator(); double calculatedFlightPrice = sut.CalculateFlightPrice(amountOfTravelers, requestingExtraLuggage, isReturnFlightIncluded); Assert.Equal(expectedPrice, calculatedFlightPrice); }
static void Main(string[] args) { AirTravelCalculator atc = new AirTravelCalculator(); Console.WriteLine("Antal personer der skal afsted"); int amountOfTravelers = int.Parse(Console.ReadLine()); Console.Clear(); Console.WriteLine("Baggage? true/false"); bool requiresExtraLuggage = bool.Parse(Console.ReadLine()); Console.Clear(); Console.WriteLine("Return flight? true/false"); bool requiresReturnFlight = bool.Parse(Console.ReadLine()); Console.Clear(); double calculatedPrice = atc.CalculateFlightPrice(amountOfTravelers, requiresExtraLuggage, requiresReturnFlight); Console.WriteLine($"Calculated price for your trip comes down to {calculatedPrice} DKK!"); Console.ReadLine(); }