private async Task <(ContentFinderByUrl finder, IPublishedRequestBuilder frequest)> GetContentFinder(string urlString)
        {
            string xml = PublishedContentXml.BaseWebTestXml(1234);

            IEnumerable <ContentNodeKit> kits = PublishedContentXmlAdapter.GetContentNodeKits(
                xml,
                TestHelper.ShortStringHelper,
                out ContentType[] contentTypes,
                out DataType[] dataTypes).ToList();
        public override void Setup()
        {
            base.Setup();

            string xml = PublishedContentXml.PublishedContentTestXml(1234, _node1173Guid);

            IEnumerable <ContentNodeKit> kits = PublishedContentXmlAdapter.GetContentNodeKits(
                xml,
                TestHelper.ShortStringHelper,
                out ContentType[] contentTypes,
                out DataType[] dataTypes).ToList();
Ejemplo n.º 3
0
        public void Ensure_Cache_Is_Correct()
        {
            var requestHandlerSettings = new RequestHandlerSettings {
                AddTrailingSlash = false
            };

            string xml = PublishedContentXml.BaseWebTestXml(1234);

            IEnumerable <ContentNodeKit> kits = PublishedContentXmlAdapter.GetContentNodeKits(
                xml,
                TestHelper.ShortStringHelper,
                out ContentType[] contentTypes,
                out DataType[] dataTypes).ToList();
Ejemplo n.º 4
0
    public override void Setup()
    {
        base.Setup();

        var xml = PublishedContentXml.BaseWebTestXml(1234);

        IEnumerable <ContentNodeKit> kits = PublishedContentXmlAdapter.GetContentNodeKits(
            xml,
            TestHelper.ShortStringHelper,
            out var contentTypes,
            out var dataTypes).ToList();

        InitializedCache(kits, contentTypes, dataTypes);
    }
Ejemplo n.º 5
0
        public override void Setup()
        {
            base.Setup();

            _webRoutingSettings     = new WebRoutingSettings();
            _requestHandlerSettings = new RequestHandlerSettings {
                AddTrailingSlash = true
            };

            GlobalSettings.HideTopLevelNodeFromPath = false;

            string xml = PublishedContentXml.BaseWebTestXml(1234);

            IEnumerable <ContentNodeKit> kits = PublishedContentXmlAdapter.GetContentNodeKits(
                xml,
                TestHelper.ShortStringHelper,
                out ContentType[] contentTypes,
                out DataType[] dataTypes).ToList();
    private async Task <(ContentFinderByUrl finder, IPublishedRequestBuilder frequest)> GetContentFinder(
        string urlString)
    {
        var xml = PublishedContentXml.BaseWebTestXml(1234);

        IEnumerable <ContentNodeKit> kits = PublishedContentXmlAdapter.GetContentNodeKits(
            xml,
            TestHelper.ShortStringHelper,
            out var contentTypes,
            out var dataTypes).ToList();

        InitializedCache(kits, contentTypes, dataTypes);

        var umbracoContextAccessor = GetUmbracoContextAccessor(urlString);
        var umbracoContext         = umbracoContextAccessor.GetRequiredUmbracoContext();
        var publishedRouter        = CreatePublishedRouter(umbracoContextAccessor);
        var frequest = await publishedRouter.CreateRequestAsync(umbracoContext.CleanedUmbracoUrl);

        var lookup = new ContentFinderByUrl(Mock.Of <ILogger <ContentFinderByUrl> >(), umbracoContextAccessor);

        return(lookup, frequest);
    }
Ejemplo n.º 7
0
    public override void Setup()
    {
        base.Setup();

        var xml = PublishedContentXml.PublishedContentTestXml(1234, _node1173Guid);

        IEnumerable <ContentNodeKit> kits = PublishedContentXmlAdapter.GetContentNodeKits(
            xml,
            TestHelper.ShortStringHelper,
            out var contentTypes,
            out var dataTypes).ToList();

        _dataTypes = dataTypes;

        // configure the Home content type to be composed of another for tests.
        var compositionType = new ContentType(TestHelper.ShortStringHelper, -1)
        {
            Alias = "MyCompositionAlias"
        };

        contentTypes.First(x => x.Alias == "Home").AddContentType(compositionType);

        InitializedCache(kits, contentTypes, dataTypes);
    }