Пример #1
0
        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);
        }
Пример #2
0
        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();
        }