public void ShouldGetFlights() { var expectedFlightCount = 30; var dummyFlights = FakeData.GenerateDummyFlight(expectedFlightCount); _flightRepoMoq.Setup(s => s.LoadFlights()).Returns(() => dummyFlights); var module = new FlightModule(_flightRepoMoq.Object); var flights = module.LoadFlights(); Assert.AreEqual(expectedFlightCount, flights.Count); }
public void ShouldCalculateFuelBetwenTwoAirportsWhenGetFlight() { var expectedAmountOfFuel = 46808.6; var dummyFlightBetweenCasaParis = FakeData.GetFlightBetweenCasaParis(); _flightRepoMoq.Setup(s => s.LoadFlights()).Returns(() => new List <Flight>() { dummyFlightBetweenCasaParis }); var module = new FlightModule(_flightRepoMoq.Object); var result = module.LoadFlights().SingleOrDefault(); Assert.AreEqual(expectedAmountOfFuel, result.AmountOfFuel); }
public void ShouldCalculateDistanceBetwenTwoAirportsWhenGetFlight() { var expectedDistanceInKm = 1933; var dummyFlightBetweenCasaParis = FakeData.GetFlightBetweenCasaParis(); _flightRepoMoq.Setup(s => s.LoadFlights()).Returns(() => new List <Flight>() { dummyFlightBetweenCasaParis }); var module = new FlightModule(_flightRepoMoq.Object); var result = module.LoadFlights().SingleOrDefault(); Assert.AreEqual(expectedDistanceInKm, result.DistanceInKM); }