Ejemplo n.º 1
0
        public LocationRepositoryTest()
        {
            dbContext = new Mock <IDatabaseContext>();

            Mock <DbSet <Location> > locationsMock = DbContextTestUtils.CreateDbSetMock(mockLocationsList);

            dbContext.Setup(context => context.Locations).Returns(locationsMock.Object);

            repository = new LocationRepository(dbContext.Object);
        }
Ejemplo n.º 2
0
        public UserRepositoryTest()
        {
            dbContext = new Mock <IDatabaseContext>();

            mockUsersList = populateMockUsersList();

            Mock <DbSet <User> > usersMock = DbContextTestUtils.CreateDbSetMock(mockUsersList);

            dbContext.Setup(context => context.Users).Returns(usersMock.Object);

            repository = new UserRepository(dbContext.Object);
        }