示例#1
0
        public void EmployeeRegister_ShouldAddEmployees()
        {
            var employees        = EmployeeFactory.GetEmployeesRecord();
            var employeeRegister = new EmployeeRegister();

            employeeRegister.AddEmployeesRecord(employees);
            Assert.Equal(employees, employeeRegister.GetEmployeesRecord());
        }
示例#2
0
        public void EmployeeRegister_ShouldReadEmployee()
        {
            var employees        = EmployeeFactory.GetEmployeesRecord();
            var employeeRegister = new EmployeeRegister();

            employeeRegister.AddEmployeesRecord(employees);

            Assert.NotEqual(EmployeeFactory.GetEmployeeRecord(), employeeRegister.GetEmployeeRecord(5));
        }
示例#3
0
        public void EmployeeFixture_ShouldUpdateEmployee()
        {
            var employees        = EmployeeFactory.GetEmployeesRecord();
            var employeeRegister = new EmployeeRegister();

            employeeRegister.AddEmployeesRecord(employees);
            var newEmployee = new Employee()
            {
                EmpId   = 5,
                EmpName = "emp5",
                EmpRole = EmployeeRole.Admin
            };

            employeeRegister.UpdateEmployeeRecord(newEmployee);
            Assert.Equal(newEmployee, employeeRegister.GetEmployeeRecord(5));
        }