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