Ejemplo n.º 1
0
        public void Test_Read_Write_Equals_From_Absolute_Url()
        {
            string absoluteUrl = "https://www.dr.dk/sitemap.xml";
            string s           = string.Empty;
            Urlset urlset      = null;

            using (var httpLoader = new HttpLoader(new Url(absoluteUrl)))
            {
                try
                {
                    urlset = httpLoader.Urlsets.FirstOrDefault();
                    if (urlset == null)
                    {
                        Assert.Fail($"urlset expected from {urlset} is null");
                    }
                    s = Composer.ComposeUrlset(httpLoader.Urlsets.First());
                }
                catch (Exception ex)
                {
                    Assert.Fail($"error {ex.Message}");
                }
            }
            var loader = new Loader();

            loader.Add(urlset);

            Assert.IsTrue(loader.Urlsets.First().Entities.Count == urlset.Entities.Count);
        }