public void CreateInvoiceItem_OneTimePlusPremiumEach_RegularEquipment(int rentDays) { // Arrange var rentedItem = new EquipmentItem { EquipmentType = EquipmentType.Regular, RentalDays = rentDays }; var handler = new GenerateInvoiceMessageHandler(_options, _logger); // Act var result = handler.CreateInvoiceItem(rentedItem); // Assert Assert.Equal(_options.Value.OneTimeFee + rentDays * _options.Value.PremiumFee, result.RentalPrice); }
public void CreateInvoiceItem_PremiumThreePlusRegularEach_SpecializedEquipment(int rentDays) { // Arrange var rentedItem = new EquipmentItem { EquipmentType = EquipmentType.Specialized, RentalDays = rentDays }; var handler = new GenerateInvoiceMessageHandler(_options, _logger); // Act var result = handler.CreateInvoiceItem(rentedItem); // Assert var expected = 3 * _options.Value.PremiumFee + (rentDays - 3) * _options.Value.RegularFee; Assert.Equal(expected, result.RentalPrice); }