public async void All()
        {
            Mock <ILogger <VoteTypeRepository> > loggerMoc = VoteTypeRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = VoteTypeRepositoryMoc.GetContext();
            var repository = new VoteTypeRepository(loggerMoc.Object, context);
            var records    = await repository.All();

            records.Should().NotBeEmpty();
            records.Count.Should().Be(1);
        }
Exemple #2
0
        public async void All()
        {
            Mock <ILogger <VoteTypeRepository> > loggerMoc = VoteTypeRepositoryMoc.GetLoggerMoc();
            ApplicationDbContext context = VoteTypeRepositoryMoc.GetContext();
            var repository = new VoteTypeRepository(loggerMoc.Object, context);

            VoteType entity = new VoteType();

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

            var record = await repository.All();

            record.Should().NotBeEmpty();
        }