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