GetDeduction() 공개 메소드

public GetDeduction ( ) : double
리턴 double
예제 #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);
 }
예제 #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);
 }
예제 #3
0
 public void DeductionShouldBeZeroWhenNoDonationUnder80G()
 {
     DonationsUnder80G donationsUnder80G = new DonationsUnder80G();
     Assert.AreEqual(0,donationsUnder80G.GetDeduction(),0.001);
 }
예제 #4
0
 public void DeductionShouldBeEqualToHalfOfHalfExemptDeductionWhenOneHalfExemptDonationUnder80GIsAdded()
 {
     DonationsUnder80G donationsUnder80G = new DonationsUnder80G();
     donationsUnder80G.AddDonation(new HalfExemptDonation(10));
     Assert.AreEqual(5, donationsUnder80G.GetDeduction(), 0.001);
 }