示例#1
0
        public void GetEmployeeByIdTest(int id)
        {
            //Arrange
            Employee expected = new Employee()
            {
                Id = 1, FirstName = "John", LastName = "Roberts", Department = Department.HR, Salary = 50000
            };

            Employee result = new Employee();

            //Act
            result = employeeOperations.GetEmployeeById(id);

            //Assert
            Assert.AreEqual(expected.Id, result.Id);
            Assert.AreEqual(expected.FirstName, result.FirstName);
            Assert.AreEqual(expected.LastName, result.LastName);
            Assert.AreEqual(expected.Department, result.Department);
            Assert.AreEqual(expected.Salary, result.Salary);
        }
示例#2
0
 public IActionResult Get(int id)
 {
     return(Ok(_employeeOperations.GetEmployeeById(id)));
 }