public void Execute_FeeShouldBeCorrectWithMultiple(List <Payment> payments, int monthlyFee, double expectedFee) { var rule = new FixedMonthlyFee(monthlyFee); double finalFee = 0; foreach (var payment in payments) { finalFee = rule.Execute(payment).Fee; } Assert.Equal(expectedFee, finalFee); }
public void Execute_FeeShouldBeCorrectWithSinglePayment(string merchant, DateTime time, double startingFee, double expectedFee, int monthlyFee) { var payment = new Payment { Fee = startingFee, Merchant = merchant, Time = time }; var rule = new FixedMonthlyFee(monthlyFee); payment = rule.Execute(payment); Assert.Equal(expectedFee, payment.Fee); }