protected override void establish_context()
        {
            base.establish_context();

            _repository = new PageDataRepository(new DataFactoryQueryExecutor());

            var pageType = PageType.List().First();

            _root = PageReference.RootPage;
            var start = DataFactory.Instance.GetDefaultPageData(_root, pageType.ID);
            start.PageName = "start";
            start.URLSegment = "start";
            _start = DataFactory.Instance.Save(start, SaveAction.Publish);

            var child = DataFactory.Instance.GetDefaultPageData(start.PageLink, pageType.ID);
            child.PageName = "child";
            child.URLSegment = "child";
            _child = DataFactory.Instance.Save(child, SaveAction.Publish);

            var child2 = DataFactory.Instance.GetDefaultPageData(start.PageLink, pageType.ID);
            child2.PageName = "child";
            child2.URLSegment = "child";
            child2.StopPublish = DateTime.Today;
            _child2 = DataFactory.Instance.Save(child2, SaveAction.Publish);
        }
예제 #2
0
    public void Setup()
    {
        var context            = TestHelpers.CreateContext();
        var pageDataRepository = new PageDataRepository(context, TestHelpers.AspenMapper);
        var loggerMock         = new Mock <ILogger <PageDataController> >();

        pageDataController = new PageDataController(pageDataRepository, loggerMock.Object);
    }
 protected override void establish_context()
 {
     base.establish_context();
     executor = MockRepository.GenerateStub<IQueryExecutor>();
     system_under_test = new PageDataRepository(executor);
 }
예제 #4
0
 protected override void establish_context()
 {
     Initializer.Start();
     _repository = new PageDataRepository(new DataFactoryQueryExecutor());
     _pageDataFactory = new PageDataFactory();
 }