public PostRepositoryTests(MongoDbDatabaseFixture fixture) : base(fixture) { SeedDatabase(); _uow = ServiceProvider.GetService <IBlogUnitOfWork>(); _postRepository = (PostRepository)_uow.Posts; }
public AuthorRepositoryTests(MongoDbDatabaseFixture fixture) : base(fixture) { SeedDatabase(); var uow = ServiceProvider.GetService <IBlogUnitOfWork>(); _repository = (AuthorRepository)uow.Authors; }
public SearchPostsQueryTests(MongoDbDatabaseFixture fixture) : base(fixture) { SeedDatabase(); var uow = ServiceProvider.GetRequiredService <IBlogUnitOfWork>(); var options = ServiceProvider.GetRequiredService <IOptionsSnapshot <PineBlogOptions> >(); var postUrlHelper = ServiceProvider.GetRequiredService <PostUrlHelper>(); var fileUrlHelper = ServiceProvider.GetRequiredService <FileUrlHelper>(); searchPostsQueryHandler = new SearchPostsQuery.Handler(uow, options, postUrlHelper, fileUrlHelper); }
public SearchPostsQueryTests(MongoDbDatabaseFixture fixture) : base(fixture) { SeedDatabase(); var uow = ServiceProvider.GetRequiredService <IBlogUnitOfWork>(); var options = ServiceProvider.GetRequiredService <IOptionsSnapshot <PineBlogOptions> >(); var postUrlHelper = ServiceProvider.GetRequiredService <PostUrlHelper>(); var fileUrlHelper = ServiceProvider.GetRequiredService <FileUrlHelper>(); var postRankerMock = new Mock <IPostRanker>(); postRankerMock .Setup(m => m.Rank(It.IsAny <IEnumerable <Post> >(), It.IsAny <string>())) .Returns((IEnumerable <Post> posts, string _) => posts); searchPostsQueryHandler = new SearchPostsQuery.Handler(uow, postRankerMock.Object, options, postUrlHelper, fileUrlHelper); }
public BlogSettingsRepositoryTests(MongoDbDatabaseFixture fixture) : base(fixture) { _uow = ServiceProvider.GetRequiredService <IBlogUnitOfWork>(); _blogSettingsRepository = (BlogSettingsRepository)_uow.BlogSettings; }