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