From ced98b4c057f6e22c8d6079685c08bbd893f9ae1 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 14 Jan 2024 21:01:44 +0200 Subject: [PATCH 1/5] Update unit tests --- .../GenerateSitemapsIntegrationTests.cs | 24 ++-- .../GenerateSitemapIndexIntegrationTests.cs | 20 +-- .../TestFileSystemWrapper.cs | 5 +- .../SerializedXmlSaver/DeserializeTests.cs | 22 ++-- .../SerializeAndSaveTests.cs | 116 +++++++++--------- .../GenerateSitemapsTests.cs | 103 ++++++++-------- .../GenerateSitemapIndexTests.cs | 97 +++++++-------- .../X.Web.Sitemap.Tests.csproj | 39 ++++-- 8 files changed, 207 insertions(+), 219 deletions(-) diff --git a/tests/X.Web.Sitemap.Tests/IntegrationTests/SitemapGeneratorIntegrationTests/GenerateSitemapsIntegrationTests.cs b/tests/X.Web.Sitemap.Tests/IntegrationTests/SitemapGeneratorIntegrationTests/GenerateSitemapsIntegrationTests.cs index 214d1fa..8bd532c 100644 --- a/tests/X.Web.Sitemap.Tests/IntegrationTests/SitemapGeneratorIntegrationTests/GenerateSitemapsIntegrationTests.cs +++ b/tests/X.Web.Sitemap.Tests/IntegrationTests/SitemapGeneratorIntegrationTests/GenerateSitemapsIntegrationTests.cs @@ -1,30 +1,30 @@ -using System; -using System.Collections.Generic; -using System.IO; -using NUnit.Framework; +using Xunit; namespace X.Web.Sitemap.Tests.IntegrationTests.SitemapGeneratorIntegrationTests; -[TestFixture] -public class GenerateSitemapsIntegrationTests +public class GenerateSitemapsIntegrationTests : IDisposable { private SitemapGenerator _sitemapGenerator; private readonly string _sitemapLocation = Path.GetTempPath(); - [SetUp] - public void SetUp() + public GenerateSitemapsIntegrationTests() { _sitemapGenerator = new SitemapGenerator(); } - [Test] + public void Dispose() + { + // Cleanup code if needed + } + + [Fact] public void It_Only_Saves_One_Sitemap_If_There_Are_Less_Than_50001_Urls() { //--arrange var maxNumberOfUrlsForOneSitemap = Sitemap.DefaultMaxNumberOfUrlsPerSitemap; var urls = new List(maxNumberOfUrlsForOneSitemap); var now = DateTime.UtcNow; - + for (var i = 0; i < maxNumberOfUrlsForOneSitemap; i++) { urls.Add(Url.CreateUrl("https://example.com/" + i, now)); @@ -37,14 +37,14 @@ public void It_Only_Saves_One_Sitemap_If_There_Are_Less_Than_50001_Urls() //--go look in the {sitemapLocation} directory! } - [Test] + [Fact] public void It_Saves_Two_Sitemaps_If_There_Are_More_Than_50000_Urls_But_Less_Than_100001_And_It_Names_The_Files_With_A_Three_Digit_Suffix_Incrementing_For_Each_One() { //--arrange var enoughUrlsForTwoSitemaps = Sitemap.DefaultMaxNumberOfUrlsPerSitemap + 1; var urls = new List(enoughUrlsForTwoSitemaps); var now = DateTime.UtcNow; - + for (var i = 0; i < enoughUrlsForTwoSitemaps; i++) { urls.Add(Url.CreateUrl("https://example.com/" + i, now)); diff --git a/tests/X.Web.Sitemap.Tests/IntegrationTests/SitemapIndexGeneratorIntegrationTests/GenerateSitemapIndexIntegrationTests.cs b/tests/X.Web.Sitemap.Tests/IntegrationTests/SitemapIndexGeneratorIntegrationTests/GenerateSitemapIndexIntegrationTests.cs index 2b71513..bb78d9a 100644 --- a/tests/X.Web.Sitemap.Tests/IntegrationTests/SitemapIndexGeneratorIntegrationTests/GenerateSitemapIndexIntegrationTests.cs +++ b/tests/X.Web.Sitemap.Tests/IntegrationTests/SitemapIndexGeneratorIntegrationTests/GenerateSitemapIndexIntegrationTests.cs @@ -1,23 +1,23 @@ -using System; -using System.Collections.Generic; -using System.IO; -using NUnit.Framework; +using Xunit; namespace X.Web.Sitemap.Tests.IntegrationTests.SitemapIndexGeneratorIntegrationTests; -[TestFixture] -public class GenerateSitemapIndexIntegrationTests +public class GenerateSitemapIndexIntegrationTests : IDisposable { private SitemapIndexGenerator _sitemapIndexGenerator; private readonly string _sitemapLocation = Path.GetTempPath(); - [SetUp] - public void SetUp() + public GenerateSitemapIndexIntegrationTests() { _sitemapIndexGenerator = new SitemapIndexGenerator(); } - [Test] + public void Dispose() + { + // Cleanup code if needed + } + + [Fact] public void It_Saves_A_Generated_Sitemap_Index_File_From_The_Specified_Sitemaps() { //--arrange @@ -26,7 +26,7 @@ public void It_Saves_A_Generated_Sitemap_Index_File_From_The_Specified_Sitemaps( new SitemapInfo(new Uri("https://example.com"), DateTime.UtcNow), new SitemapInfo(new Uri("https://example2.com"), DateTime.UtcNow.AddDays(-1)) }; - + var expectedDirectory = new DirectoryInfo(_sitemapLocation); var expectedFilename = "testSitemapIndex1.xml"; diff --git a/tests/X.Web.Sitemap.Tests/TestFileSystemWrapper.cs b/tests/X.Web.Sitemap.Tests/TestFileSystemWrapper.cs index a61ca94..31af564 100644 --- a/tests/X.Web.Sitemap.Tests/TestFileSystemWrapper.cs +++ b/tests/X.Web.Sitemap.Tests/TestFileSystemWrapper.cs @@ -1,7 +1,4 @@ -using System.IO; -using System.Threading.Tasks; - -namespace X.Web.Sitemap.Tests; +namespace X.Web.Sitemap.Tests; public class TestFileSystemWrapper : IFileSystemWrapper { diff --git a/tests/X.Web.Sitemap.Tests/UnitTests/SerializedXmlSaver/DeserializeTests.cs b/tests/X.Web.Sitemap.Tests/UnitTests/SerializedXmlSaver/DeserializeTests.cs index 0d00059..77756d2 100644 --- a/tests/X.Web.Sitemap.Tests/UnitTests/SerializedXmlSaver/DeserializeTests.cs +++ b/tests/X.Web.Sitemap.Tests/UnitTests/SerializedXmlSaver/DeserializeTests.cs @@ -1,19 +1,15 @@ -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.IO; +using Xunit; namespace X.Web.Sitemap.Tests.UnitTests.SerializedXmlSaver; -[TestFixture] public class DeserializeTests { - [Test] - public void Check_That_XmlFile_Deserialized() - { - var xml = File.ReadAllText("Data/example.xml"); - var sitemap = Sitemap.Parse(xml); - - Assert.NotNull(sitemap); - } + [Fact] + public void Check_That_XmlFile_Deserialized() + { + var xml = File.ReadAllText("Data/example.xml"); + var sitemap = Sitemap.Parse(xml); + + Assert.NotNull(sitemap); + } } \ No newline at end of file diff --git a/tests/X.Web.Sitemap.Tests/UnitTests/SerializedXmlSaver/SerializeAndSaveTests.cs b/tests/X.Web.Sitemap.Tests/UnitTests/SerializedXmlSaver/SerializeAndSaveTests.cs index 7a83982..42082c6 100644 --- a/tests/X.Web.Sitemap.Tests/UnitTests/SerializedXmlSaver/SerializeAndSaveTests.cs +++ b/tests/X.Web.Sitemap.Tests/UnitTests/SerializedXmlSaver/SerializeAndSaveTests.cs @@ -1,67 +1,61 @@ -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml.Serialization; +using Xunit; namespace X.Web.Sitemap.Tests.UnitTests.SerializedXmlSaver; -[TestFixture] public class SerializeAndSaveTests { - private IFileSystemWrapper _fileSystemWrapper; - - [SetUp] - public void SetUp() - { - _fileSystemWrapper = new TestFileSystemWrapper(); - } - - //--this is a half-assed test as comparing the full XML string that is generated is a big pain. - [Test] - public void It_Saves_The_XML_File_To_The_Correct_Directory_And_File_Name() - { - //--arrange - var sitemapIndex = new SitemapIndex(new List - { - new SitemapInfo(new Uri("http://example.com/sitemap1.xml"), DateTime.UtcNow), - new SitemapInfo(new Uri("http://example.com/sitemap2.xml"), DateTime.UtcNow.AddDays(-1)) - }); - - var fileName = "sitemapindex.xml"; - var directory = new DirectoryInfo("x"); - var path = Path.Combine(directory.FullName, fileName); - - var serializer = new SitemapIndexSerializer(); - var xml = serializer.Serialize(sitemapIndex); - - //--act - var result = _fileSystemWrapper.WriteFile(xml, path); - - Assert.True(result.FullName.Contains("sitemapindex")); - Assert.AreEqual(directory.Name, result.Directory.Name); - Assert.AreEqual(fileName, result.Name); - } - - [Test] - public void It_Returns_A_File_Info_For_The_File_That_Was_Created() - { - //--arrange - var expectedFileInfo = new FileInfo("something/file.xml"); - var sitemapIndex = new SitemapIndex(new List()); - - var serializer = new SitemapIndexSerializer(); - var xml = serializer.Serialize(sitemapIndex); - - var fileName = "file.xml"; - var directory = new DirectoryInfo("something"); - var path = Path.Combine(directory.FullName, fileName); - - //--act - var result = _fileSystemWrapper.WriteFile(xml, path); - - Assert.AreEqual(expectedFileInfo.FullName, result.FullName); - Assert.AreEqual(expectedFileInfo.Directory, result.Directory); - } - + private IFileSystemWrapper _fileSystemWrapper; + + public SerializeAndSaveTests() + { + _fileSystemWrapper = new TestFileSystemWrapper(); + } + + [Fact] + public void It_Saves_The_XML_File_To_The_Correct_Directory_And_File_Name() + { + //--arrange + var sitemapIndex = new SitemapIndex(new List + { + new SitemapInfo(new Uri("http://example.com/sitemap1.xml"), DateTime.UtcNow), + new SitemapInfo(new Uri("http://example.com/sitemap2.xml"), DateTime.UtcNow.AddDays(-1)) + }); + + var fileName = "sitemapindex.xml"; + var directory = new DirectoryInfo("x"); + var path = Path.Combine(directory.FullName, fileName); + + var serializer = new SitemapIndexSerializer(); + var xml = serializer.Serialize(sitemapIndex); + + //--act + var result = _fileSystemWrapper.WriteFile(xml, path); + + //--assert + Assert.True(result.FullName.Contains("sitemapindex")); + Assert.Equal(directory.Name, result.Directory.Name); + Assert.Equal(fileName, result.Name); + } + + [Fact] + public void It_Returns_A_File_Info_For_The_File_That_Was_Created() + { + //--arrange + var expectedFileInfo = new FileInfo("something/file.xml"); + var sitemapIndex = new SitemapIndex(new List()); + + var serializer = new SitemapIndexSerializer(); + var xml = serializer.Serialize(sitemapIndex); + + var fileName = "file.xml"; + var directory = new DirectoryInfo("something"); + var path = Path.Combine(directory.FullName, fileName); + + //--act + var result = _fileSystemWrapper.WriteFile(xml, path); + + //--assert + Assert.Equal(expectedFileInfo.FullName, result.FullName); + Assert.Equal(expectedFileInfo.Directory.Name, result.Directory.Name); + } } \ No newline at end of file diff --git a/tests/X.Web.Sitemap.Tests/UnitTests/SitemapGeneratorTests/GenerateSitemapsTests.cs b/tests/X.Web.Sitemap.Tests/UnitTests/SitemapGeneratorTests/GenerateSitemapsTests.cs index 2bfd40d..a61da79 100644 --- a/tests/X.Web.Sitemap.Tests/UnitTests/SitemapGeneratorTests/GenerateSitemapsTests.cs +++ b/tests/X.Web.Sitemap.Tests/UnitTests/SitemapGeneratorTests/GenerateSitemapsTests.cs @@ -1,60 +1,55 @@ -using NUnit.Framework; -using System.Collections.Generic; -using System.IO; -using System.Linq; +using Xunit; namespace X.Web.Sitemap.Tests.UnitTests.SitemapGeneratorTests; -[TestFixture] public class GenerateSitemapsTests { - private SitemapGenerator _sitemapGenerator; - - [SetUp] - public void SetUp() - { - _sitemapGenerator = new SitemapGenerator(); - } - - [Test] - public void It_Only_Saves_One_Sitemap_If_There_Are_Less_Than_50001_Urls() - { - var filesCount = 4; - var recordsCount = (Sitemap.DefaultMaxNumberOfUrlsPerSitemap * 3) + 5; - var urls = new List(); - - for (var i = 0; i < recordsCount; i++) - { - urls.Add(new Url()); - } - - var result = _sitemapGenerator.GenerateSitemaps(urls, new DirectoryInfo("x"), "file"); - - Assert.AreEqual(filesCount, result.Count); - } - - [Test] - public void It_Saves_Two_Sitemaps_If_There_Are_More_Than_50000_Urls_But_Less_Than_100001_And_It_Names_The_Files_With_A_Three_Digit_Suffix_Incrementing_For_Each_One() - { - //--arrange - var enoughForTwoSitemaps = Sitemap.DefaultMaxNumberOfUrlsPerSitemap + 1; - var urls = new List(enoughForTwoSitemaps); - var filesCount = 2; - - for (var i = 0; i < enoughForTwoSitemaps; i++) - { - urls.Add(new Url()); - } - - var fileName = "file"; - var directory = new DirectoryInfo("x"); - - //--act - var result = _sitemapGenerator.GenerateSitemaps(urls, directory, fileName); - - Assert.AreEqual(filesCount, result.Count); - Assert.True(result.All(o => o.Directory.Name == directory.Name)); - Assert.True(result.Any(o => o.Name == "file-1.xml")); - Assert.True(result.Any(o => o.Name == "file-2.xml")); - } + private SitemapGenerator _sitemapGenerator; + + public GenerateSitemapsTests() + { + _sitemapGenerator = new SitemapGenerator(); + } + + [Fact] + public void It_Only_Saves_One_Sitemap_If_There_Are_Less_Than_50001_Urls() + { + var filesCount = 4; + var recordsCount = (Sitemap.DefaultMaxNumberOfUrlsPerSitemap * 3) + 5; + var urls = new List(); + + for (var i = 0; i < recordsCount; i++) + { + urls.Add(new Url()); + } + + var result = _sitemapGenerator.GenerateSitemaps(urls, new DirectoryInfo("x"), "file"); + + Assert.Equal(filesCount, result.Count); + } + + [Fact] + public void It_Saves_Two_Sitemaps_If_There_Are_More_Than_50000_Urls_But_Less_Than_100001_And_It_Names_The_Files_With_A_Three_Digit_Suffix_Incrementing_For_Each_One() + { + //--arrange + var enoughForTwoSitemaps = Sitemap.DefaultMaxNumberOfUrlsPerSitemap + 1; + var urls = new List(enoughForTwoSitemaps); + var filesCount = 2; + + for (var i = 0; i < enoughForTwoSitemaps; i++) + { + urls.Add(new Url()); + } + + var fileName = "file"; + var directory = new DirectoryInfo("x"); + + //--act + var result = _sitemapGenerator.GenerateSitemaps(urls, directory, fileName); + + Assert.Equal(filesCount, result.Count); + Assert.All(result, o => Assert.Equal(directory.Name, o.Directory.Name)); + Assert.Contains(result, o => o.Name == "file-1.xml"); + Assert.Contains(result, o => o.Name == "file-2.xml"); + } } \ No newline at end of file diff --git a/tests/X.Web.Sitemap.Tests/UnitTests/SitemapIndexGeneratorTests/GenerateSitemapIndexTests.cs b/tests/X.Web.Sitemap.Tests/UnitTests/SitemapIndexGeneratorTests/GenerateSitemapIndexTests.cs index 1b6b4b2..1124d3a 100644 --- a/tests/X.Web.Sitemap.Tests/UnitTests/SitemapIndexGeneratorTests/GenerateSitemapIndexTests.cs +++ b/tests/X.Web.Sitemap.Tests/UnitTests/SitemapIndexGeneratorTests/GenerateSitemapIndexTests.cs @@ -1,59 +1,50 @@ -using System; -using System.Collections.Generic; -using System.IO; -using NUnit.Framework; +using Xunit; namespace X.Web.Sitemap.Tests.UnitTests.SitemapIndexGeneratorTests; -[TestFixture] public class GenerateSitemapIndexTests { - private SitemapIndexGenerator _sitemapIndexGenerator; - private TestFileSystemWrapper _fileSystemWrapper; - - [SetUp] - public void SetUp() - { - _fileSystemWrapper = new TestFileSystemWrapper(); - _sitemapIndexGenerator = new SitemapIndexGenerator(_fileSystemWrapper); - } - - [Test] - public void It_Saves_A_Generated_Sitemap_Index_File_From_The_Specified_Sitemaps() - { - //--arrange - var sitemaps = new List - { - new SitemapInfo(new Uri("https://example.com"), DateTime.UtcNow), - new SitemapInfo(new Uri("https://example2.com"), DateTime.UtcNow.AddDays(-1)) - }; - - var expectedDirectory = new DirectoryInfo(@"C:\temp\sitemaptests\"); - var expectedFilename = "testSitemapIndex1.xml"; - - //--act - var sitemapIndex = _sitemapIndexGenerator.GenerateSitemapIndex(sitemaps, expectedDirectory, expectedFilename); - Assert.True(AssertCorrectSitemapIndexWasSerialized(sitemaps, sitemapIndex)); - - //--assert - //_sitemapIndexSerializer - // .Received() - // .SerializeAndSave( - // Arg.Is(x => AssertCorrectSitemapIndexWasSerialized(sitemaps, x)), - // Arg.Is(x => x == expectedDirectory), - // Arg.Is(x => x == expectedFilename)); - } - - private bool AssertCorrectSitemapIndexWasSerialized(IEnumerable expectedSitemaps, SitemapIndex actualSitemapIndex) - { - foreach (var expectedSitemap in expectedSitemaps) - { - if (!actualSitemapIndex.Sitemaps.Contains(expectedSitemap)) - { - Assert.Fail("Received a call to .SerializeAndSave, but at least one of the expected sitemapInfos was missing."); - } - } - - return true; - } + private SitemapIndexGenerator _sitemapIndexGenerator; + private TestFileSystemWrapper _fileSystemWrapper; + + public GenerateSitemapIndexTests() + { + _fileSystemWrapper = new TestFileSystemWrapper(); + _sitemapIndexGenerator = new SitemapIndexGenerator(_fileSystemWrapper); + } + + [Fact] + public void It_Saves_A_Generated_Sitemap_Index_File_From_The_Specified_Sitemaps() + { + //--arrange + var sitemaps = new List + { + new SitemapInfo(new Uri("https://example.com"), DateTime.UtcNow), + new SitemapInfo(new Uri("https://example2.com"), DateTime.UtcNow.AddDays(-1)) + }; + + var expectedDirectory = new DirectoryInfo(@"C:\temp\sitemaptests\"); + var expectedFilename = "testSitemapIndex1.xml"; //--act + var sitemapIndex = + _sitemapIndexGenerator.GenerateSitemapIndex(sitemaps, expectedDirectory, expectedFilename); + + // Custom assertion + Assert.True(AssertCorrectSitemapIndexWasSerialized(sitemaps, sitemapIndex)); + } + + private bool AssertCorrectSitemapIndexWasSerialized(IEnumerable expectedSitemaps, + SitemapIndex actualSitemapIndex) + { + foreach (var expectedSitemap in expectedSitemaps) + { + if (!actualSitemapIndex.Sitemaps.Contains(expectedSitemap)) + { + // xUnit does not have a direct equivalent of Assert.Fail, so we throw an exception instead + throw new Xunit.Sdk.XunitException( + "Received a call to .SerializeAndSave, but at least one of the expected sitemapInfos was missing."); + } + } + + return true; + } } \ No newline at end of file diff --git a/tests/X.Web.Sitemap.Tests/X.Web.Sitemap.Tests.csproj b/tests/X.Web.Sitemap.Tests/X.Web.Sitemap.Tests.csproj index 47b31e8..a82c56b 100644 --- a/tests/X.Web.Sitemap.Tests/X.Web.Sitemap.Tests.csproj +++ b/tests/X.Web.Sitemap.Tests/X.Web.Sitemap.Tests.csproj @@ -1,22 +1,37 @@ + + net8.0 + enable + enable + + false + true default - Library - net6.0;net7.0 + - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + - + - - Always - + + - + + PreserveNewest + - \ No newline at end of file + + + From c5404306cb4cda87da5f1d5966aec4b4a6aac365 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 14 Jan 2024 21:01:57 +0200 Subject: [PATCH 2/5] Update TargetFrameworks --- src/X.Web.Sitemap.Example/X.Web.Sitemap.Example.csproj | 2 +- src/X.Web.Sitemap/X.Web.Sitemap.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/X.Web.Sitemap.Example/X.Web.Sitemap.Example.csproj b/src/X.Web.Sitemap.Example/X.Web.Sitemap.Example.csproj index 3cbac4e..4b97327 100644 --- a/src/X.Web.Sitemap.Example/X.Web.Sitemap.Example.csproj +++ b/src/X.Web.Sitemap.Example/X.Web.Sitemap.Example.csproj @@ -2,7 +2,7 @@ Exe - net6.0 + net8.0 enable enable diff --git a/src/X.Web.Sitemap/X.Web.Sitemap.csproj b/src/X.Web.Sitemap/X.Web.Sitemap.csproj index bd7a199..19a4daa 100644 --- a/src/X.Web.Sitemap/X.Web.Sitemap.csproj +++ b/src/X.Web.Sitemap/X.Web.Sitemap.csproj @@ -18,7 +18,7 @@ 2.9.2.0 default enable - net6.0;net7.0;netstandard2.0;netstandard2.1 + net6.0;net7.0;netstandard2.0;netstandard2.1;net8.0 README.md From 6738e4addbb2767d2b7f73a826b1cc35661209ba Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 14 Jan 2024 21:09:36 +0200 Subject: [PATCH 3/5] Update packages --- tests/X.Web.Sitemap.Tests/X.Web.Sitemap.Tests.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/X.Web.Sitemap.Tests/X.Web.Sitemap.Tests.csproj b/tests/X.Web.Sitemap.Tests/X.Web.Sitemap.Tests.csproj index a82c56b..ad51409 100644 --- a/tests/X.Web.Sitemap.Tests/X.Web.Sitemap.Tests.csproj +++ b/tests/X.Web.Sitemap.Tests/X.Web.Sitemap.Tests.csproj @@ -11,9 +11,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all From 935884f15a0224b4aedac1f6cc2878632d794762 Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 14 Jan 2024 21:10:04 +0200 Subject: [PATCH 4/5] Example of how change default max number of sitemaps --- src/X.Web.Sitemap.Example/Program.cs | 5 ++++- src/X.Web.Sitemap/Sitemap.cs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/X.Web.Sitemap.Example/Program.cs b/src/X.Web.Sitemap.Example/Program.cs index 03ad01f..5950dbd 100644 --- a/src/X.Web.Sitemap.Example/Program.cs +++ b/src/X.Web.Sitemap.Example/Program.cs @@ -1,8 +1,11 @@ -using X.Web.Sitemap.Example; +using X.Web.Sitemap; +using X.Web.Sitemap.Example; using X.Web.Sitemap.Example.Examples; Console.WriteLine("OK"); +Sitemap.DefaultMaxNumberOfUrlsPerSitemap = 50000; + IExample example1 = new SitemapGenerationWithSitemapIndexExample(); example1.Run(); diff --git a/src/X.Web.Sitemap/Sitemap.cs b/src/X.Web.Sitemap/Sitemap.cs index 7a860a7..b6aa0b9 100644 --- a/src/X.Web.Sitemap/Sitemap.cs +++ b/src/X.Web.Sitemap/Sitemap.cs @@ -14,7 +14,7 @@ namespace X.Web.Sitemap; [XmlRoot(ElementName = "urlset", Namespace = "http://www.sitemaps.org/schemas/sitemap/0.9")] public class Sitemap : List, ISitemap { - public static int DefaultMaxNumberOfUrlsPerSitemap = 50000; + public static int DefaultMaxNumberOfUrlsPerSitemap { get; set; } = 5000; public Sitemap() { From 685342d09d89b7691f78a142a9344f1f9f3f02ee Mon Sep 17 00:00:00 2001 From: Andrew Date: Sun, 14 Jan 2024 21:11:47 +0200 Subject: [PATCH 5/5] Update version --- src/X.Web.Sitemap/X.Web.Sitemap.csproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/X.Web.Sitemap/X.Web.Sitemap.csproj b/src/X.Web.Sitemap/X.Web.Sitemap.csproj index 19a4daa..f613a5a 100644 --- a/src/X.Web.Sitemap/X.Web.Sitemap.csproj +++ b/src/X.Web.Sitemap/X.Web.Sitemap.csproj @@ -1,7 +1,7 @@ - 2.9.2 + 2.9.3 This library allows you quickly and easily generate sitemap files. Andrew Gubskiy https://github.com/ernado-x/X.Web.Sitemap @@ -12,13 +12,13 @@ xsitemap Andrew Gubskiy sitemap, web, asp.net, sitemap.xml - 2.9.2 + 2.9.3 X.Sitemap - 2.9.2.0 - 2.9.2.0 + 2.9.3.0 + 2.9.3.0 default enable - net6.0;net7.0;netstandard2.0;netstandard2.1;net8.0 + net6.0;net8.0;netstandard2.0;netstandard2.1 README.md