InstaTax.Core.DomainObjects.DonationsUnder80G.GetDeduction C# (CSharp) Метод

GetDeduction() публичный Метод

public GetDeduction ( ) : double
Результат double
        public double GetDeduction()
        {
            double total = 0;
            foreach (var donationUnder80G in Donations)
            {
                total += donationUnder80G.GetDeduction();
            }
            return total;
        }

Usage 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);
 }
All Usage Examples Of InstaTax.Core.DomainObjects.DonationsUnder80G::GetDeduction