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