Пример #1
0
        public void BikeRentalFactoryDoesNotBreakIfDuplicatedByNameBikeRentalTypeExistsInConfig()
        {
            var xml = XDocument.Load("BikeRentalTypesDuplicatedNames.xml");
            IBikeRentalTypesService bikeRentalTypesService = new XmlBikeRentalTypesService(xml);
            IBikeRentalFactory      bikeRentalFactoryEmpty = new BikeRentalFactory(bikeRentalTypesService);

            Assert.AreEqual(2, bikeRentalFactoryEmpty.GetBikeRentalsCount(), "Bike Rental Factory should have only 2 Bike Rental Types");
        }
Пример #2
0
        public void BikeRentalFactoryDoesNotBreakIfInvalidDiscountBikeRentalTypeExistsInConfig()
        {
            var xml = XDocument.Load("BikeRentalTypesBrokenInvalidDiscount.xml");
            IBikeRentalTypesService bikeRentalTypesService = new XmlBikeRentalTypesService(xml);
            IBikeRentalFactory      bikeRentalFactoryEmpty = new BikeRentalFactory(bikeRentalTypesService);

            Assert.AreEqual(0, bikeRentalFactoryEmpty.GetBikeRentalsCount(), "Bike Rental Factory should have no Bike Rental Types.");
        }