public void AnyDuplicatedUpperBound_ReutrnTrueWhenUpperBoundHasSameValue(List <TaxBand> taxBands, bool expectedResult) { var helper = new TaxBandHelper(); var anyDuplicatedUpperBound = helper.AnyDuplicatedUpperBound(taxBands); anyDuplicatedUpperBound.Should().Be(expectedResult); }
public void AnyTailBand_ReutrnTrueWhenBandWithNullUpperBondPresent(List <TaxBand> taxBands, bool expectedResult) { var helper = new TaxBandHelper(); var anyDuplicatedUpperBound = helper.AnyTailBand(taxBands); anyDuplicatedUpperBound.Should().Be(expectedResult); }
public void Sort_ReturnTaxBandSortedByUpperBound(List <TaxBand> taxBands, List <TaxBand> expectedResult) { var helper = new TaxBandHelper(); var sortedTaxBands = helper.Sort(taxBands); sortedTaxBands.Should().HaveCount(3); sortedTaxBands.Should().Equal(expectedResult); }
public static decimal GetTaxRate(decimal income, FileStatusEnum fileStatus) { if (fileStatus == FileStatusEnum.Single) { return(TaxBandHelper.SingleBands().First(b => income >= b.Lower && income <= b.Upper).Rate); } if (fileStatus == FileStatusEnum.MarriedJointly) { return(TaxBandHelper.MarriedJointBands().First(b => income >= b.Lower && income <= b.Upper).Rate); } throw new Exception($"FileStatus Unknown, unable to continue."); }