public void Sitemap_ShouldThrowExceptionOnEmptyLocation() { var sitemap = new SitemapDocument(); var date = new DateTime(2019, 5, 4); Assert.Throws <Exception>(() => sitemap.AddUrl(new UrlElement("", date, ChangeFrequency.MONTHLY, Priority.MEDIUM))); }
public void Sitemap_ShouldReturnXDocument() { var sitemap = new SitemapDocument(); var date = new DateTime(2019, 5, 4); sitemap.AddUrl(new UrlElement(@"http://localhost", date, ChangeFrequency.MONTHLY, Priority.MEDIUM)); Assert.IsType <XDocument>(sitemap.GenerateSitemap()); Assert.NotEmpty(sitemap.GenerateSitemap().ToString()); }