public void SetEmployee_RequestNotExistingEmployee_SetsEmployeeInRepository() { // arrange Mock<IRepository> mockedRepository = CreateMockedRepository(); var service = new EmployeeService(mockedRepository.Object); const int employeeId = 23; var employeeInfo = new EmployeeInfo { Id = employeeId }; // act service.SetEmployee(employeeInfo); // assert mockedRepository.Verify(p => p.SetEmployee(It.Is<Employee>(e => e.Id == employeeId))); }
public void SetEmployee_EmployeeNullReference_ThrowsException() { // arrange Mock<IRepository> mockedRepository = CreateMockedRepository(); var service = new EmployeeService(mockedRepository.Object); // act service.SetEmployee(null); }