Example #1
0
        public void GetEmployeesTest()
        {
            //Arrange
            List <Employee> expected = new List <Employee>
            {
                new Employee {
                    Id = 1, FirstName = "John", LastName = "Roberts", Department = Department.HR, Salary = 50000
                },
                new Employee {
                    Id = 2, FirstName = "Jack", LastName = "Kurata", Department = Department.Marketing, Salary = 70000
                },
                new Employee {
                    Id = 3, FirstName = "Sara", LastName = "Smith", Department = Department.Development, Salary = 70000
                },
                new Employee {
                    Id = 4, FirstName = "Alisa", LastName = "James", Department = Department.Finance, Salary = 55000
                },
            };
            List <Employee> result = new List <Employee>();

            //Act
            result = employeeOperations.GetAllEmployees().ToList();

            //Assert
            Assert.AreEqual(expected[0].Id, result[0].Id);
            Assert.AreEqual(expected[0].FirstName, result[0].FirstName);
            Assert.AreEqual(expected[0].LastName, result[0].LastName);
            Assert.AreEqual(expected[0].Department, result[0].Department);
            Assert.AreEqual(expected[0].Salary, result[0].Salary);
        }
Example #2
0
 public IActionResult Get()
 {
     return(Ok(_employeeOperations.GetAllEmployees().ToList()));
 }