Пример #1
0
        private static IncomeTaxTable GetIncomeTaxTable()
        {
            var table = new IncomeTaxTable();

            table.AddNewEntry(0, 18200, 0);
            table.AddNewEntry(37001, 80000, 3572, new PlusInfo {
                PlusValue = 0.325, PlusOver = 37000
            });
            table.AddNewEntry(80001, 180000, 17547, new PlusInfo {
                PlusValue = 0.37, PlusOver = 80000
            });

            return(table);
        }
Пример #2
0
        public void Can_Add_New_Entry()
        {
            var table = new IncomeTaxTable();

            table.AddNewEntry(0, 18200, 0);

            Assert.AreEqual(1, table.Entries);
        }
Пример #3
0
        public void Can_Get_Income_Tax()
        {
            var table = new IncomeTaxTable();

            table.AddNewEntry(0, 18200, 0);

            var incomeTax = table.GetIncomeTax(18200);

            Assert.AreEqual(0, incomeTax);
        }
Пример #4
0
        public void Can_Get_Entry_Based_On_Salary()
        {
            var table = new IncomeTaxTable();

            table.AddNewEntry(37001, 80000, 3572);

            var entry = table.GetEntry(60050);

            Assert.AreEqual(37001, entry.Min);
            Assert.AreEqual(80000, entry.Max);
        }
Пример #5
0
        public void Can_Add_New_Entry_With_Plus()
        {
            var table = new IncomeTaxTable();

            var plusInfo = new PlusInfo {
                PlusValue = 0.325, PlusOver = 37000
            };

            table.AddNewEntry(37001, 80000, 3572, plusInfo);

            Assert.AreEqual(1, table.Entries);
        }
Пример #6
0
        public void Can_Get_Entry()
        {
            var table = new IncomeTaxTable();

            table.AddNewEntry(0, 18200, 0);

            var entry = table.GetEntry(0, 18200);

            Assert.AreEqual(0, entry.Min);
            Assert.AreEqual(18200, entry.Max);
            Assert.AreEqual(0, entry.Value);
        }
Пример #7
0
        public void Can_Get_Income_Tax_With_Plus()
        {
            var table = new IncomeTaxTable();

            var plusInfo = new PlusInfo {
                PlusValue = 0.325, PlusOver = 37000
            };

            table.AddNewEntry(37001, 80000, 3572, plusInfo);

            var incomeTax = table.GetIncomeTax(60050);

            Assert.AreEqual(922, incomeTax);
        }
Пример #8
0
        public void Can_Get_Entry_With_Plus()
        {
            var table = new IncomeTaxTable();

            var plusInfo = new PlusInfo {
                PlusValue = 0.325, PlusOver = 37000
            };

            table.AddNewEntry(37001, 80000, 3572, plusInfo);

            var entry = table.GetEntry(37001, 80000);

            Assert.AreEqual(37001, entry.Min);
            Assert.AreEqual(80000, entry.Max);
            Assert.AreEqual(3572, entry.Value);
            Assert.AreEqual(0.325, entry.PlusInfo.PlusValue);
            Assert.AreEqual(37000, entry.PlusInfo.PlusOver);
        }