Esempio n. 1
0
 private EmployeeCostViewModel MapToViewModel(EmployeeCostPerPaycheckDto cost)
 {
     return(new EmployeeCostViewModel {
         Pay = cost.Pay,
         BenefitsDiscount = cost.BenefitsDiscount,
         BenefitsDeduction = cost.BenefitsDeduction,
         DependentsBenefitsDeduction = cost.DependentBenefitsDeduction,
         NetCost = cost.NetCost
     });
 }
Esempio n. 2
0
        public void CalculateTests(Employee employee, EmployeeCostPerPaycheckDto expected)
        {
            // Act
            var result = new EmployeeCostCalculator().Calculate(employee);

            // Assert
            Assert.AreEqual(Math.Round(expected.Pay, 5), Math.Round(result.Pay));
            Assert.AreEqual(Math.Round(expected.BenefitsDiscount, 5), Math.Round(result.BenefitsDiscount, 5));
            Assert.AreEqual(Math.Round(expected.BenefitsDeduction, 5), Math.Round(result.BenefitsDeduction, 5));
            Assert.AreEqual(Math.Round(expected.DependentBenefitsDeduction, 5), Math.Round(result.DependentBenefitsDeduction, 5));
            Assert.AreEqual(Math.Round(expected.NetCost, 5), Math.Round(result.NetCost, 5));
        }