예제 #1
0
        public void Title_WhenCalledWithEntryContentBaseWithSeoTitle_ShouldReturnFormatTitleOfNodeAndEntry()
        {
            var seoInformation = new SeoInformation()
            {
                Title = "Entry Seo Tittle"
            };

            _entryContentMock.Setup(c => c.SeoInformation).Returns(seoInformation);


            var nodeSeoInformation = new SeoInformation()
            {
                Title = "Node Seo Tittle"
            };

            _nodeContentMock.Setup(c => c.SeoInformation).Returns(nodeSeoInformation);
            var contentLoaderMock = SetupContentLoader();

            contentLoaderMock.Setup(c => c.Get <CatalogContentBase>(It.IsAny <ContentReference>())).Returns(_nodeContentMock.Object);
            _contentRouteHelperMock.Setup(c => c.Content).Returns(() => _entryContentMock.Object);

            var subject = new HeadController(contentLoaderMock.Object, _contentRouteHelperMock.Object);
            var result  = subject.Title();

            Assert.Equal <string>("Entry Seo Tittle - Node Seo Tittle-Quicksilver", ((ContentResult)result).Content);
        }
예제 #2
0
        public void Title_WhenCalledWithEntryContentBaseWithoutSeoTitle_ShouldReturnFormatDisplayNameOfNodeAndEntry()
        {
            var seoInformation = new SeoInformation()
            {
                Description = "Entry Seo"
            };

            _entryContentMock.Setup(c => c.SeoInformation).Returns(seoInformation);
            _entryContentMock.Setup(c => c.DisplayName).Returns("Entry");

            var nodeSeoInformation = new SeoInformation()
            {
                Description = "Node Seo"
            };

            _nodeContentMock.Setup(c => c.SeoInformation).Returns(nodeSeoInformation);
            _nodeContentMock.Setup(c => c.DisplayName).Returns("Node");

            var contentLoaderMock = SetupContentLoader();
            contentLoaderMock.Setup(c => c.Get<CatalogContentBase>(It.IsAny<ContentReference>())).Returns(_nodeContentMock.Object);
            _contentRouteHelperMock.Setup(c => c.Content).Returns(() => _entryContentMock.Object);

            var subject = new HeadController(contentLoaderMock.Object, _contentRouteHelperMock.Object);
            var result = subject.Title();

            Assert.Equal<string>("Entry - Node-Quicksilver", ((ContentResult)result).Content);
        }
예제 #3
0
        public void Title_WhenCalledWithNodeContentWithSeoTitle_ShouldReturnFormatSeoTitle()
        {
            var seoInformation = new SeoInformation()
            {
                Title = "Seo Tittle"
            };

            _nodeContentMock.Setup(c => c.SeoInformation).Returns(seoInformation);
            _contentRouteHelperMock.Setup(c => c.Content).Returns(() => _nodeContentMock.Object);

            var subject = new HeadController(SetupContentLoader().Object, _contentRouteHelperMock.Object);
            var result  = subject.Title();

            Assert.Equal <string>("Seo Tittle-Quicksilver", ((ContentResult)result).Content);
        }
예제 #4
0
        public void Title_WhenCalledWithNodeContentWithSeoTitle_ShouldReturnFormatSeoTitle()
        {
            var seoInformation = new SeoInformation()
            {
                Title = "Seo Tittle"
            };

            _nodeContentMock.Setup(c => c.SeoInformation).Returns(seoInformation);
            _contentRouteHelperMock.Setup(c => c.Content).Returns(() => _nodeContentMock.Object);

            var subject = new HeadController(SetupContentLoader().Object, _contentRouteHelperMock.Object);
            var result = subject.Title();

            Assert.AreEqual<string>("Seo Tittle-Quicksilver", ((ContentResult)result).Content);
        }
예제 #5
0
        public void Title_WhenCalledWithNodeContentWithoutSeoTitle_ShouldReturnFormatName()
        {
            var seoInformation = new SeoInformation()
            {
                Description = "Without seo title"
            };

            _nodeContentMock.Setup(c => c.SeoInformation).Returns(seoInformation);
            _nodeContentMock.Setup(c => c.DisplayName).Returns("Display Name");
            _contentRouteHelperMock.Setup(c => c.Content).Returns(() => _nodeContentMock.Object);

            var subject = new HeadController(SetupContentLoader().Object, _contentRouteHelperMock.Object);
            var result = subject.Title();

            Assert.Equal<string>("Display Name-Quicksilver", ((ContentResult)result).Content);
        }
예제 #6
0
        public void Title_WhenCalledWithNodeContentWithoutSeoTitle_ShouldReturnFormatName()
        {
            var seoInformation = new SeoInformation()
            {
                Description = "Without seo title"
            };

            _nodeContentMock.Setup(c => c.SeoInformation).Returns(seoInformation);
            _nodeContentMock.Setup(c => c.DisplayName).Returns("Display Name");
            _contentRouteHelperMock.Setup(c => c.Content).Returns(() => _nodeContentMock.Object);

            var subject = new HeadController(SetupContentLoader().Object, _contentRouteHelperMock.Object);
            var result  = subject.Title();

            Assert.Equal("Display Name-Quicksilver", ((ContentResult)result).Content);
        }
예제 #7
0
        public void Title_WhenCalledWithEntryContentBaseBeneathCatalogEntry_ShouldReturnFormatContainsCatalogName()
        {
            var expectedTitle = "Fashion Catalog";

            var seoInformation = new SeoInformation()
            {
                Description = "Entry Seo"
            };

            _entryContentMock.Setup(c => c.SeoInformation).Returns(seoInformation);
            _entryContentMock.Setup(c => c.DisplayName).Returns("Entry");
            _catalogContentMock.Setup(c => c.Name).Returns("Fashion Catalog");

            var contentLoaderMock = SetupContentLoader();
            contentLoaderMock.Setup(c => c.Get<CatalogContentBase>(It.IsAny<ContentReference>())).Returns(_catalogContentMock.Object);
            _contentRouteHelperMock.Setup(c => c.Content).Returns(() => _entryContentMock.Object);

            var subject = new HeadController(contentLoaderMock.Object, _contentRouteHelperMock.Object);
            var result = subject.Title();
            Assert.Contains(expectedTitle, ((ContentResult)result).Content);
        }
예제 #8
0
        public void Title_WhenCalledWithEntryContentBaseBeneathCatalogEntry_ShouldReturnFormatContainsCatalogName()
        {
            var expectedTitle = "Fashion Catalog";

            var seoInformation = new SeoInformation()
            {
                Description = "Entry Seo"
            };

            _entryContentMock.Setup(c => c.SeoInformation).Returns(seoInformation);
            _entryContentMock.Setup(c => c.DisplayName).Returns("Entry");
            _catalogContentMock.Setup(c => c.Name).Returns("Fashion Catalog");

            var contentLoaderMock = SetupContentLoader();

            contentLoaderMock.Setup(c => c.Get <CatalogContentBase>(It.IsAny <ContentReference>())).Returns(_catalogContentMock.Object);
            _contentRouteHelperMock.Setup(c => c.Content).Returns(() => _entryContentMock.Object);

            var subject = new HeadController(contentLoaderMock.Object, _contentRouteHelperMock.Object);
            var result  = subject.Title();

            Assert.Contains(expectedTitle, ((ContentResult)result).Content);
        }