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"); }
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."); }