InstaTax.Core.DomainObjects.OtherIncomes.Add C# (CSharp) Метод

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

public Add ( OtherIncomeItem otherIncomeItemToAdd ) : void
otherIncomeItemToAdd OtherIncomeItem
Результат void
        public void Add(OtherIncomeItem otherIncomeItemToAdd)
        {
            if (otherIncomeItemToAdd == null) throw new ArgumentNullException();
            otherIncomeItems.Add(otherIncomeItemToAdd);
        }

Usage Example

Пример #1
0
        public void MustCalculateNetPayableTaxWithAnnualSalaryOtherIncomesAndChapter6Investments()
        {
            var taxPayer = new User(50000, true, Gender.Female);

            TaxSlabs ts = TaxSlabs.GetInstance();
            AnnualSalary asal = new AnnualSalary
            {
                Basic = 810000.50,
                Hra = 1000,
                ProfessionalTax = 100,
                SpecialAllowance = 10
            };

            OtherIncomes otherIncomes = new OtherIncomes();
            otherIncomes.Add(new OtherIncomeItem("Income from Interest", 4000.0));
            otherIncomes.Add(new OtherIncomeItem("Income from House Rent", 8000.0));

            Chapter6Investments investments = new Chapter6Investments();
            investments.Add(new LifeInsurance(50000));
            investments.Add(new Elss(60000));

            TaxStatement stmt = new TaxStatement(asal, taxPayer);
            stmt.HousingLoanInterest = new HousingLoanInterest(10000);
            stmt.OtherIncomes = otherIncomes;
            stmt.Chapter6Investments = investments;

            Assert.AreEqual(120473,
                stmt.CalculateNetPayableTax(), 2);
        }
All Usage Examples Of InstaTax.Core.DomainObjects.OtherIncomes::Add