public async void All() { Mock <ILogger <SpaceRepository> > loggerMoc = SpaceRepositoryMoc.GetLoggerMoc(); ApplicationDbContext context = SpaceRepositoryMoc.GetContext(); var repository = new SpaceRepository(loggerMoc.Object, context); var records = await repository.All(); records.Should().NotBeEmpty(); records.Count.Should().Be(1); }
public async void All() { Mock <ILogger <SpaceRepository> > loggerMoc = SpaceRepositoryMoc.GetLoggerMoc(); ApplicationDbContext context = SpaceRepositoryMoc.GetContext(); var repository = new SpaceRepository(loggerMoc.Object, context); Space entity = new Space(); context.Set <Space>().Add(entity); await context.SaveChangesAsync(); var record = await repository.All(); record.Should().NotBeEmpty(); }