Пример #1
0
        public async void All()
        {
            Mock <ILogger <VPersonRepository> > loggerMoc = VPersonRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = VPersonRepositoryMoc.GetContext();
            var repository = new VPersonRepository(loggerMoc.Object, context);
            var records    = await repository.All();

            records.Should().NotBeEmpty();
            records.Count.Should().Be(1);
        }
Пример #2
0
        public async void All()
        {
            Mock <ILogger <VPersonRepository> > loggerMoc = VPersonRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = VPersonRepositoryMoc.GetContext();
            var repository = new VPersonRepository(loggerMoc.Object, context);

            VPerson entity = new VPerson();

            context.Set <VPerson>().Add(entity);
            await context.SaveChangesAsync();

            var record = await repository.All();

            record.Should().NotBeEmpty();
        }