예제 #1
0
        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);
        }
예제 #2
0
 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;
 }
예제 #4
0
 public GitDbContextTests(GitDbFixture fixture) : base(fixture)
 {
     _options      = ServiceProvider.GetService <IOptions <PineBlogGitDbOptions> >();
     _gitDbContext = GitDbContext.Create(_options.Value);
 }
예제 #5
0
 public PostRepositoryTests(GitDbFixture fixture) : base(fixture)
 {
     _uow            = ServiceProvider.GetRequiredService <IBlogUnitOfWork>();
     _postRepository = (PostRepository)_uow.Posts;
 }