GetDeduction() public method

public GetDeduction ( ) : double
return double
Example #1
0
 public void DeductionShouldBeEqualToApprpriateDonationUnder80GIsAddedWhenOneFullyExemptAndOneHalfExemptIsAdded()
 {
     DonationsUnder80G donationsUnder80G = new DonationsUnder80G();
     donationsUnder80G.AddDonation(new HalfExemptDonation(10));
     donationsUnder80G.AddDonation(new FullyExemptDonation(10));
     Assert.AreEqual(15, donationsUnder80G.GetDeduction(), 0.001);
 }
Example #2
0
 public void TotalDeductionShouldBeEqualToApprpriateSumOfDonationsApplicableToIndividualDonations()
 {
     DonationsUnder80G donationsUnder80G = new DonationsUnder80G();
     donationsUnder80G.AddDonation(new HalfExemptDonation(10));
     donationsUnder80G.AddDonation(new HalfExemptDonation(10));
     donationsUnder80G.AddDonation(new FullyExemptDonation(10));
     donationsUnder80G.AddDonation(new FullyExemptDonation(10));
     Assert.AreEqual(30, donationsUnder80G.GetDeduction(), 0.001);
 }
Example #3
0
 public void DeductionShouldBeZeroWhenNoDonationUnder80G()
 {
     DonationsUnder80G donationsUnder80G = new DonationsUnder80G();
     Assert.AreEqual(0,donationsUnder80G.GetDeduction(),0.001);
 }
Example #4
0
 public void DeductionShouldBeEqualToHalfOfHalfExemptDeductionWhenOneHalfExemptDonationUnder80GIsAdded()
 {
     DonationsUnder80G donationsUnder80G = new DonationsUnder80G();
     donationsUnder80G.AddDonation(new HalfExemptDonation(10));
     Assert.AreEqual(5, donationsUnder80G.GetDeduction(), 0.001);
 }