public SearchPostsQueryTests(GitDbFixture fixture) : base(fixture) { 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 AuthorRepositoryTests(GitDbFixture fixture) : base(fixture) { _uow = ServiceProvider.GetRequiredService <IBlogUnitOfWork>(); _authorRepository = (AuthorRepository)_uow.Authors; }
public BlogSettingsRepositoryTests(GitDbFixture fixture) : base(fixture) { _uow = ServiceProvider.GetRequiredService <IBlogUnitOfWork>(); _blogSettingsRepository = (BlogSettingsRepository)_uow.BlogSettings; }
public GitDbContextTests(GitDbFixture fixture) : base(fixture) { _options = ServiceProvider.GetService <IOptions <PineBlogGitDbOptions> >(); _gitDbContext = GitDbContext.Create(_options.Value); }
public PostRepositoryTests(GitDbFixture fixture) : base(fixture) { _uow = ServiceProvider.GetRequiredService <IBlogUnitOfWork>(); _postRepository = (PostRepository)_uow.Posts; }