public PageVersionsController(
     IPageVersionRepository pageVersionRepository,
     IPageVersionObjectsConverter objectsConverter)
 {
     _pageVersionRepository = pageVersionRepository;
     _objectsConverter      = objectsConverter;
 }
        public PageVersionsControllerTests()
        {
            _fixture = new Fixture();

            _pageVersionRepositoryMock = Substitute.For <IPageVersionRepository>();

            _objectsConverterMock = Substitute.For <IPageVersionObjectsConverter>();
            _objectsConverterMock
            .ConvertToPageVersionResponse(Arg.Any <PageVersion>())
            .Returns(callInfo =>
            {
                var pageVersion = callInfo.Arg <PageVersion>();

                return(new PageVersionResponse()
                {
                    Id = pageVersion.Id,
                    Text = pageVersion.Text,
                    Author = pageVersion.Author,
                    DateTime = pageVersion.DateTime,
                    PageId = pageVersion.PageId
                });
            });

            _pageVersionsController = new PageVersionsController(_pageVersionRepositoryMock, _objectsConverterMock);
        }
示例#3
0
 public PageProvider(
     IPageRepository pageRepository,
     IPageTemplateRepository pageTemplateRepository,
     IPageVersionRepository pageVersionRepository)
 {
     _pageRepository         = pageRepository;
     _pageTemplateRepository = pageTemplateRepository;
     _pageVersionRepository  = pageVersionRepository;
 }
示例#4
0
 public PagesController(
     IPageRepository pageRepository,
     IPageVersionRepository pageVersionRepository,
     IHttpContextAccessor httpContextAccessor,
     IThemeRepository themeRepository,
     IPageTemplateRepository pageTemplateRepository,
     IPageService pageService)
 {
     _pageRepository         = pageRepository;
     _pageVersionRepository  = pageVersionRepository;
     _httpContextAccessor    = httpContextAccessor;
     _themeRepository        = themeRepository;
     _pageTemplateRepository = pageTemplateRepository;
     _pageService            = pageService;
 }