public InvoiceDtoQueryHandler( IRepository <CartEquipment> cartEquipments, ILoyaltyPointsProvider loyaltyPointsProvider, IMapper <EquipmentType, IRentalCostStrategy> mapPriceCalculatorLogic, IMutablePriceConfiguration mutablePriceConfiguration) { if (cartEquipments == null) { throw new ArgumentNullException(nameof(cartEquipments)); } if (loyaltyPointsProvider == null) { throw new ArgumentNullException(nameof(loyaltyPointsProvider)); } if (mapPriceCalculatorLogic == null) { throw new ArgumentNullException(nameof(mapPriceCalculatorLogic)); } if (mutablePriceConfiguration == null) { throw new ArgumentNullException(nameof(mutablePriceConfiguration)); } _cartEquipments = cartEquipments; _loyaltyPointsProvider = loyaltyPointsProvider; _mapPriceCalculatorLogic = mapPriceCalculatorLogic; _mutablePriceConfiguration = mutablePriceConfiguration; }
public void Constructor_Throws_If_Equipments_Is_Null() { _loyaltyPointsProvider = null; // Act, Assert Assert.Throws <ArgumentNullException>(() => new InvoiceDtoQueryHandler(_cartEquipment, _loyaltyPointsProvider, _mapPriceCalculatorLogic, _mutablePriceConfiguration)); }
public void Init() { _cartEquipment = Mock.Of <IRepository <CartEquipment> >(); _loyaltyPointsProvider = Mock.Of <ILoyaltyPointsProvider>(); _mapPriceCalculatorLogic = Mock.Of <IMapper <EquipmentType, IRentalCostStrategy> >(); _mutablePriceConfiguration = Mock.Of <IMutablePriceConfiguration>(); _invoiceDtoQueryHandler = new InvoiceDtoQueryHandler(_cartEquipment, _loyaltyPointsProvider, _mapPriceCalculatorLogic, _mutablePriceConfiguration); }
public void Init() { var time = new DateTime(2000, 10, 10); _carts = Mock.Of <IRepository <Cart> >(); _writeDbContext = Mock.Of <IWriteDbContext>(); _equipments = Mock.Of <IRepository <Equipment> >(); _mapEquipmentDto = Mock.Of <IMapper <Equipment, EquipmentDto> >(); _dateTimeProvider = Mock.Of <IDateTimeProvider>(o => o.Now == time); _loyaltyPointsProvider = Mock.Of <ILoyaltyPointsProvider>(); _priceCalculatorLogic = Mock.Of <IMapper <EquipmentType, IRentalCostStrategy> >(); //_rentalService = new RentalService(_carts, _writeDbContext, _equipments, _mapEquipmentDto, _dateTimeProvider, _loyaltyPointsProvider, _priceCalculatorLogic); }