Exemplo n.º 1
0
        public void TestSmith100Hourly()
        {  // arrange
            Employee emp = new Employee("Bert", "Smith", Employee.HOURLY, 100);

            // act
            emp.CalculateTakeHome();

            // assert
            Assert.AreEqual(4000, emp.GrossPay);
            Assert.AreEqual(Employee.HOURLY, emp.Type);
            Assert.AreEqual(10, emp.PlanetaryTax);
            Assert.AreEqual(400, emp.SocialSecurityTax); //.10 rate
            Assert.AreEqual(400, emp.WageTax);           // .10 tax rate
            Assert.AreEqual(810, emp.TotalTaxes);
            Assert.AreEqual(3190, emp.TakeHomePay);
        }
Exemplo n.º 2
0
        public void TestBrown25Hourly()
        {
            // arrange
            Employee emp = new Employee("Malachi", "Brown", Employee.HOURLY, 25);

            // act
            emp.CalculateTakeHome();

            // assert
            Assert.AreEqual(1000, emp.GrossPay);
            Assert.AreEqual(Employee.HOURLY, emp.Type);
            Assert.AreEqual(10, emp.PlanetaryTax);
            Assert.AreEqual(100, emp.SocialSecurityTax); //.10 rate
            Assert.AreEqual(50, emp.WageTax);            // .05 tax rate
            Assert.AreEqual(160, emp.TotalTaxes);
            Assert.AreEqual(840, emp.TakeHomePay);
        }
Exemplo n.º 3
0
        public void TestSmith11000Salary()
        {
            // arrange
            Employee emp = new Employee("Bert", "Smith", Employee.SALARY, 11000);

            // act
            emp.CalculateTakeHome();

            // assert
            Assert.AreEqual(11000, emp.GrossPay);
            Assert.AreEqual(Employee.SALARY, emp.Type);
            Assert.AreEqual(2.75, emp.PlanetaryTax); // .00025
            Assert.AreEqual(1100, emp.SocialSecurityTax);
            Assert.AreEqual(2420, emp.WageTax);      // .22
            Assert.AreEqual(3522.75, emp.TotalTaxes);
            Assert.AreEqual(7477.25, emp.TakeHomePay);
        }
Exemplo n.º 4
0
        public void TestSmith6000Salary()
        {
            // arrange
            Employee emp = new Employee("Bert", "Smith", Employee.SALARY, 6000);

            // act
            emp.CalculateTakeHome();

            // assert
            Assert.AreEqual(6000, emp.GrossPay);
            Assert.AreEqual(Employee.SALARY, emp.Type);
            Assert.AreEqual(1.5, emp.PlanetaryTax); // .00025
            Assert.AreEqual(600, emp.SocialSecurityTax);
            Assert.AreEqual(1080, emp.WageTax);     // .18
            Assert.AreEqual(1681.5, emp.TotalTaxes);
            Assert.AreEqual(4318.5, emp.TakeHomePay);
        }
Exemplo n.º 5
0
        public void TestBrown11000Salary()
        {
            // arrange
            Employee emp = new Employee("Malachi", "Brown", Employee.SALARY, 11000);

            // act
            emp.CalculateTakeHome();

            // assert
            Assert.AreEqual(11000, emp.GrossPay);
            Assert.AreEqual(Employee.SALARY, emp.Type);
            Assert.AreEqual(2.75, emp.PlanetaryTax); // .00025
            Assert.AreEqual(1100, emp.SocialSecurityTax);
            Assert.AreEqual(0, emp.WageTax);         // 0
            Assert.AreEqual(1102.75, emp.TotalTaxes);
            Assert.AreEqual(9897.25, emp.TakeHomePay);
        }
Exemplo n.º 6
0
        public void TestBrown4000Salary()
        {
            // arrange
            Employee emp = new Employee("Malachi", "Brown", Employee.SALARY, 4000);

            // act
            emp.CalculateTakeHome();

            // assert
            Assert.AreEqual(4000, emp.GrossPay);
            Assert.AreEqual(Employee.SALARY, emp.Type);
            Assert.AreEqual(1, emp.PlanetaryTax); // .25 * salary/1000
            Assert.AreEqual(400, emp.SocialSecurityTax);
            Assert.AreEqual(0, emp.WageTax);      // 0
            Assert.AreEqual(401, emp.TotalTaxes);
            Assert.AreEqual(3599, emp.TakeHomePay);
        }
Exemplo n.º 7
0
        public void TestBrown150Hourly()
        {
            // arrange
            Employee emp = new Employee("Malachi", "Brown", Employee.HOURLY, 150);

            // act
            emp.CalculateTakeHome();

            // assert
            Assert.AreEqual(6000, emp.GrossPay);
            Assert.AreEqual(Employee.HOURLY, emp.Type);
            Assert.AreEqual(10, emp.PlanetaryTax);
            Assert.AreEqual(600, emp.SocialSecurityTax);
            Assert.AreEqual(600, emp.WageTax);
            Assert.AreEqual(1210, emp.TotalTaxes);
            Assert.AreEqual(4790, emp.TakeHomePay);
        }