Example #1
0
        public void MonthlyEmployeeFactoryShouldCreateHourlySalaryEmployeeDTO()
        {
            // arrange
            var employee = new Employee();
            var factory  = new MonthlyEmployeeFactory(employee);
            // act
            var dto = factory.GetEmployeeDto();

            //assert
            Assert.IsInstanceOfType(dto, typeof(MonthlySalaryEmployeeDTO));
        }
Example #2
0
        public void MonthlyEmployeeRateShouldBeOk()
        {
            //arrange
            var employee = new Employee();

            employee.HourlySalary     = 10;
            employee.ContractTypeName = "MonthlySalaryEmployee";

            //act
            var factory = new MonthlyEmployeeFactory(employee);
            var dto     = factory.GetEmployeeDto();

            //assert
            Assert.AreEqual(dto.AnnualRate, employee.MonthlySalary * 12);
        }