public void FlightRepositoryIsFound()
        {
            var repository = new FlightCsvRepository("prices", TestSetup.GiveMeALocalDummyPathMapper("prices"));

            //ArgumentException will prevent otherwise
            Assert.IsTrue(true);
        }
        public void FlightRepositoryReturnsProperAmountOfFlights()
        {
            int lon2berAmountOfFlights = 2645;
            var repository             = new FlightCsvRepository("prices", TestSetup.GiveMeALocalDummyPathMapper("prices"));
            var lon2berFlights         = repository.GetFlightsFromOriginToDestination("LON", "BER");

            Assert.AreEqual(lon2berAmountOfFlights, lon2berFlights.Count());
        }
Ejemplo n.º 3
0
        public void IntegrationTestForLONtoBERFlights()
        {
            var _flightPricesRepository = new FlightCsvRepository("prices", TestSetup.GiveMeALocalDummyPathMapper("prices"));
            var _currencyRateRepository = new CurrencyRateCsvRepository("currencies", "EUR", TestSetup.GiveMeALocalDummyPathMapper("currencies"));
            var _dataSanitizer          = new FlightDataSanitizer();
            var _priceRangeCalculator   = new FlightDataCalculator(_dataSanitizer);

            var flightsAndPrices = _flightPricesRepository.GetFlightsFromOriginToDestination("LON", "BER");
            var priceRange       = _priceRangeCalculator.CalculatePriceRange(flightsAndPrices);

            Assert.IsFalse(priceRange.MaximumPrice > 200);
            Assert.IsFalse(priceRange.MinimumPrice < 20);
        }
 public void NoRepositoryFoundThrowsException()
 {
     var repository = new FlightCsvRepository("foo", TestSetup.GiveMeALocalDummyPathMapper("foo"));
 }