public EmployeeControllerTestBase() { _employeeData = EmployeeObjectMother.CreateEmployees() .ToList(); _repository = new InMemoryObjectSet <Employee>(_employeeData); _unitOfWork = new InMemoryUnitOfWork(); _unitOfWork.Employees = _repository; _controller = new EmployeeController(_unitOfWork); }
public EmployeeControllerTestBase() { _employeeData = EmployeeObjectMother.CreateEmployees() .AsQueryable(); _repository = new Mock <IRepository <Employee> >(); _unitOfWork = new Mock <IUnitOfWork>(); _unitOfWork.Setup(u => u.Employees) .Returns(_repository.Object); _controller = new WorkerController(_unitOfWork.Object); }