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