public void GetAllHallCountWithotEntity() { ApplicationDbContext dbContext = new ApplicationDbContext(new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()).Options); var repository = new EfDeletableEntityRepository <GamingHall>(dbContext); UsersHallsService usersHallsService = new UsersHallsService(new EfRepository <UsersHalls>(dbContext)); var service = new GamingHallService(repository, usersHallsService); Assert.Equal(0, service.GetAllHallsCount()); dbContext.Database.EnsureDeleted(); }
public async Task GetAllHallCountWithEntity() { ApplicationDbContext dbContext = new ApplicationDbContext(new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()).Options); var repository = new EfDeletableEntityRepository <GamingHall>(dbContext); UsersHallsService usersHallsService = new UsersHallsService(new EfRepository <UsersHalls>(dbContext)); var service = new GamingHallService(repository, usersHallsService); await service.AddAsync( "hall1", null, "desc1", "1111", "adress1", "town", "1"); Assert.Equal(1, service.GetAllHallsCount()); dbContext.Database.EnsureDeleted(); }