public void ArgumentOutOfRangeExceptionShouldBeThrown(decimal annualConsumption) { var tariff = new PackagedElectricityTariff() { Name = string.Empty, AnnualTariffCost = 1, AnnualTariffAmount = 1, ExtraConsumptionCost = 1 }; Assert.Throws <ArgumentOutOfRangeException>(() => tariff.CalculateAnnualCosts(annualConsumption)); }
public void InvalidOperationExceptionShouldBeThrown(decimal annualTariffCost, decimal annualTariffAmount, decimal extraConsumptionCost) { var tariff = new PackagedElectricityTariff() { Name = string.Empty, AnnualTariffCost = annualTariffCost, AnnualTariffAmount = annualTariffAmount, ExtraConsumptionCost = extraConsumptionCost }; Assert.Throws <InvalidOperationException>(() => tariff.CalculateAnnualCosts(1)); }
public void IsAnnualCostCalculatedCorrectly(decimal annualTariffCost, decimal annualTariffAmount, decimal extraConsumptionCost, decimal annualConsumption, decimal expectedAnnualCost) { var tariff = new PackagedElectricityTariff() { Name = string.Empty, AnnualTariffCost = annualTariffCost, AnnualTariffAmount = annualTariffAmount, ExtraConsumptionCost = extraConsumptionCost }; var actualAnnualCost = tariff.CalculateAnnualCosts(annualConsumption); Assert.Equal(expectedAnnualCost, actualAnnualCost); }