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