public void InitializeTest() { _mockUsersDBSet = new Mock <DbSet <Users> >(); _mockUsersDBSet.SetSource(UsersDataFactory.GetUsers()); var contextMock = new AppreciationContext(); contextMock.Users = _mockUsersDBSet.Object; var unitOfWork = new UnitOfWork(contextMock); var repository = new UsersRepository(unitOfWork); _userService = new UsersService(repository); }