예제 #1
0
        public void GivenNoPartitionedData_ConvertToSitemap_CreatesASitemapResult()
        {
            // Arrange.
            var partitionedData = SimpleSiteMapHelpers.CreateFakeSitemapNodes(0, StartDate);

            // Act.
            var result = SitemapService.ConvertToXmlSitemap(partitionedData);

            // Assert.
            var expectedXml = File.ReadAllText("Result Data//SitemapWith0Items.xml");

            CompareTwoSitemapDocuments(result, expectedXml);
        }
예제 #2
0
        public void GivenDataWith1Item_ConvertToSiteMap_WithAppendPageParamQueryDisabled_CreatesASitemapResult()
        {
            // Act.
            var data = SimpleSiteMapHelpers.CreateFakeSitemapNodes(1, StartDate, pageParamQuery: false).ToPartition(10);

            // Act.
            var result = SitemapService.ConvertToXmlSitemap(data);

            // Assert.
            var expectedXml = File.ReadAllText("Result Data//SitemapWithNoPageQueryParam.xml");

            CompareTwoSitemapDocuments(result, expectedXml);
        }
예제 #3
0
        public void GivenNoPartitionedData_ConvertToSitemap_CreatesASitemapResult()
        {
            // Arrange.r
            var startDate       = DateTime.SpecifyKind(new DateTime(2014, 11, 21, 18, 58, 00), DateTimeKind.Utc);
            var partitionedData = SimpleSiteMapHelpers.CreateFakeSitemapNodes(0, startDate);
            var siteMapService  = new SitemapService();

            // Act.
            var result = siteMapService.ConvertToXmlSitemap(partitionedData);

            // Assert.
            var expectedXml = File.ReadAllText("Result Data\\SitemapWith0Items.xml");

            CompareTwoSitemapDocuments(result, expectedXml);
        }
예제 #4
0
        public void GivenNoData_ConvertToSiteMap_CreatesAUrlsetWithNoNodes()
        {
            // Arrange.
            var startDate      = DateTime.SpecifyKind(new DateTime(2014, 11, 21, 18, 58, 00), DateTimeKind.Utc);
            var data           = SimpleSiteMapHelpers.CreateFakeSitemapNodes(0, startDate);
            var siteMapService = new SitemapService();

            // Act.
            var result = siteMapService.ConvertToXmlUrlset(data);

            // Assert.
            var expectedXml = File.ReadAllText("Result Data\\UrlsetWith0Items.xml");

            // My sample data is a bit messed up - which is why I have to do the `replace`.
            CompareTwoUrlsetDocuments(result, expectedXml);
        }