Beispiel #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);
        }
Beispiel #2
0
        public void MustCalculateNetPayableTaxWithOnlyAnnualSalary()
        {
            var          taxPayer = new User(50000, true, Gender.Female);
            TaxSlabs     ts       = TaxSlabs.GetInstance();
            AnnualSalary asal     = new AnnualSalary
            {
                Basic            = 200000.50,
                Hra              = 1000,
                ProfessionalTax  = 100,
                SpecialAllowance = 10
            };
            TaxStatement stmt = new TaxStatement(asal, taxPayer);

            Assert.AreEqual(1891.05d, stmt.CalculateNetPayableTax());
        }
Beispiel #3
0
        public void MustCalculateNetPayableTaxWithAnnualSalaryAndDeductions()
        {
            var          taxPayer = new User(0, true, Gender.Female);
            TaxSlabs     ts       = TaxSlabs.GetInstance();
            AnnualSalary asal     = new AnnualSalary
            {
                Basic = 600000,
                Hra   = 100000
            };
            TaxStatement      stmt = new TaxStatement(asal, taxPayer);
            DonationsUnder80G donationsUnder80G = new DonationsUnder80G();

            donationsUnder80G.AddDonation(new FullyExemptDonation(1000));
            stmt.DonationsUnder80G = donationsUnder80G;
            Assert.AreEqual(116700.0, stmt.CalculateNetPayableTax(), 0.01);
        }
Beispiel #4
0
        public void ComputeTaxShouldDeductTDSValueFromTheNetTaxPayableValue()
        {
            var          taxPayer = new User(50000, true, Gender.Female);
            TaxSlabs     ts       = TaxSlabs.GetInstance();
            AnnualSalary asal     = new AnnualSalary
            {
                Basic                = 200000.50,
                Hra                  = 1000,
                ProfessionalTax      = 100,
                SpecialAllowance     = 10,
                TaxDedeuctedAtSource = 1000
            };
            TaxStatement stmt = new TaxStatement(asal, taxPayer);

            Assert.AreEqual(891.04, stmt.CalculateNetPayableTax(), 2);
        }
Beispiel #5
0
        public void MustCalculateNetPayableTaxWithAnnualSalaryOtherIncomesAndChapter6Investments()
        {
            var          taxPayer = new User(50000, true, Gender.Female);
            TaxSlabs     ts       = TaxSlabs.GetInstance();
            AnnualSalary asal     = new AnnualSalary
            {
                Basic            = 800000.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.OtherIncomes        = otherIncomes;
            stmt.Chapter6Investments = investments;

            double totalIncome = ((asal.GetTaxableSalary() + otherIncomes.CalculateTotalAmount())
                                  -
                                  (asal.CalculateHraExemption(taxPayer.FromMetro, taxPayer.RentPaid)));

            double totalInvestments = (asal.Epf + investments.GetTotal());

            totalIncome -= totalInvestments <= Chapter6Investments.Cap
                 ? totalInvestments
                 : Chapter6Investments.Cap;

            Assert.AreEqual(120473,
                            stmt.CalculateNetPayableTax(), 2);
        }
Beispiel #6
0
        public void ShouldSaveTheInvestmentAlongWithTaxStatement()
        {
            var          taxPayer = new User(0, true, Gender.Female);
            TaxSlabs     ts       = TaxSlabs.GetInstance();
            AnnualSalary asal     = new AnnualSalary
            {
                Basic = 600000,
                Hra   = 100000
            };
            TaxStatement stmt = new TaxStatement(asal, taxPayer);

            stmt.Chapter6Investments = new Chapter6Investments();
            LifeInsurance LICInvestment = new LifeInsurance(10000);

            stmt.Chapter6Investments.Add(LICInvestment);
            LICInvestment.TaxStatement = stmt;

            Repository taxStatementRepo = new Repository();

            taxStatementRepo.Save(stmt);

            Assert.AreEqual(LICInvestment.GetAmount(), taxStatementRepo.GetInvestmentDetails(stmt.Id).GetAmount());
        }
Beispiel #7
0
        public void MustCalculateNetPayableTaxWithAnnualSalaryAndOtherIncomes()
        {
            var          taxPayer = new User(50000, true, Gender.Female);
            TaxSlabs     ts       = TaxSlabs.GetInstance();
            AnnualSalary asal     = new AnnualSalary
            {
                Basic            = 200000.50,
                Hra              = 1000,
                ProfessionalTax  = 100,
                SpecialAllowance = 10
            };
            TaxStatement stmt = new TaxStatement(asal, taxPayer);

            OtherIncomes otherIncomes = new OtherIncomes();

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

            double totalIncome = asal.GetTaxableSalary() + otherIncomes.CalculateTotalAmount();

            Assert.AreEqual(3091,
                            stmt.CalculateNetPayableTax(), 2);
        }
Beispiel #8
0
        public void ShouldNotCalculateTaxIfTaxableIncomeIsInvalid()
        {
            var taxSlabs = TaxSlabs.GetInstance();

            Assert.Throws <ArgumentException>(() => taxSlabs.ComputeTax(-500000, testMaleUser));
        }
Beispiel #9
0
        public void ShouldNotCalculateTaxIfTaxPayerDetailsAreNotAvailable()
        {
            var taxSlabs = TaxSlabs.GetInstance();

            Assert.Throws <ArgumentException>(() => taxSlabs.ComputeTax(500000, null));
        }
Beispiel #10
0
        public void ShouldReturnTaxBasedOnSecondThirdAndForthSlabIfTaxableIncomeFallsWithinForthSlabForFemale()
        {
            var taxSlabs = TaxSlabs.GetInstance();

            Assert.AreEqual(57000.3, taxSlabs.ComputeTax(500001, testFemaleUser), .01);
        }
Beispiel #11
0
        public void ShouldReturnTaxBasedOnSecondAndThirdSlabIfTaxableIncomeFallsWithinThirdSlabForMale()
        {
            var taxSlabs = TaxSlabs.GetInstance();

            Assert.AreEqual(10000.2, taxSlabs.ComputeTax(250001, testMaleUser), .01);
        }
Beispiel #12
0
        public void ShouldReturnZeroTaxIfTaxableIncomeIsLessThanFirstSlabForFemale()
        {
            var taxSlabs = TaxSlabs.GetInstance();

            Assert.AreEqual(0, taxSlabs.ComputeTax(180000, testFemaleUser));
        }