Пример #1
0
            public void GivenNoData_ConvertToSiteMap_CreatesAUrlsetWithNoNodes()
            {
                // Arrange.
                var startDate      = DateTime.SpecifyKind(new DateTime(2014, 11, 21, 18, 58, 00), DateTimeKind.Utc);
                var data           = 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);
            }
Пример #2
0
        public void GivenSomeDataAndNoChangeFreqOrPrioritySet_ConvertToSiteMap_CreatesAUrlsetResult()
        {
            // Arrange.
            var startDate      = DateTime.SpecifyKind(new DateTime(2014, 11, 21, 18, 58, 00), DateTimeKind.Utc);
            var data           = SimpleSiteMapHelpers.CreateFakeSitemapNodes(10, startDate, null, null);
            var siteMapService = new SitemapService();

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

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

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