public void SetUp() { _mocker = new AutoMoqer(); _employee = new Employee() { Id = Id, Name = Name }; _mocker.GetMock<IDbSet<Employee>>() .SetUpDbSet(new List<Employee> { _employee }); _mocker.GetMock<IDatabaseContext>() .Setup(p => p.Employees) .Returns(_mocker.GetMock<IDbSet<Employee>>().Object); _query = _mocker.Create<GetEmployeesListQuery>(); }
public void SetUp() { _mocker = new AutoMoqer(); _employee = new Employee() { Id = Id, Name = Name }; _mocker.GetMock <IDbSet <Employee> >() .SetUpDbSet(new List <Employee> { _employee }); _mocker.GetMock <IDatabaseService>() .Setup(p => p.Employees) .Returns(_mocker.GetMock <IDbSet <Employee> >().Object); _query = _mocker.Create <GetEmployeesListQuery>(); }
public void SetUp() { _mocker = new AutoMoqer(); _employee = new Employee() { Id = Id, Name = Name }; _employees = new List <Employee>() { _employee }; _mocker.GetMock <IEmployeeRepository>() .Setup(p => p.GetAll()) .Returns(_employees.AsQueryable()); _query = _mocker.Create <GetEmployeesListQuery>(); }