Exemplo n.º 1
0
        public async void All()
        {
            Mock <ILogger <FamilyRepository> > loggerMoc = FamilyRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = FamilyRepositoryMoc.GetContext();
            var repository = new FamilyRepository(loggerMoc.Object, context);
            var records    = await repository.All();

            records.Should().NotBeEmpty();
            records.Count.Should().Be(1);
        }
Exemplo n.º 2
0
        public async void All()
        {
            Mock <ILogger <FamilyRepository> > loggerMoc = FamilyRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = FamilyRepositoryMoc.GetContext();
            var repository = new FamilyRepository(loggerMoc.Object, context);

            Family entity = new Family();

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

            var record = await repository.All();

            record.Should().NotBeEmpty();
        }