예제 #1
0
        public void GetIndividualBenefitCost_StandardEmployee_ReturnsCorrectPaycheckAmount()
        {
            //arrange
            Employee           employee = new Employee("George", "Random");
            BenefitCostService service  = GetMockBenefitCostService();

            //act
            var paycheckBenefitCost = service.GetIndividualBenefitCost(employee).PaycheckBenefitCost;

            //assert
            paycheckBenefitCost.Should().Be(Math.Round(1000M / 26, 2));
        }
예제 #2
0
        public void GetIndividualBenefitCost_PersonWithNameNotStartingWithA_GetsStandardCost()
        {
            //arrange
            Employee           employee = new Employee("George", "Random");
            BenefitCostService service  = GetMockBenefitCostService();

            //act
            var annualBenefitCost = service.GetIndividualBenefitCost(employee).AnnualBenefitCost;

            //assert
            annualBenefitCost.Should().Be(1000);
        }
예제 #3
0
        public void GetIndividualBenefitCost_PersonWithNameStartingWithA_GetsDiscount()
        {
            //arrange
            Employee           employee = new Employee("Alphonso", "Miller");
            BenefitCostService service  = GetMockBenefitCostService();

            //act
            decimal annualBenefitCost = service.GetIndividualBenefitCost(employee).AnnualBenefitCost;

            //assert
            annualBenefitCost.Should().Be(900);
        }
예제 #4
0
        public void GetTotalBenefitCost_EmployeeWithDependents_GetsAdditionalCost()
        {
            //Arrange
            Employee e = new Employee("George", "Random");

            e.AddDependent(new Dependent("Claire", "Johnson"));

            BenefitCostService service = GetMockBenefitCostService();

            //act
            var annualBenefitCost = service.GetTotalBenefitCost(e).AnnualBenefitCost;

            //assert
            annualBenefitCost.Should().Be(1500);
        }