private static TorznabCapabilitiesCategories CreateTestDataset()
        {
            var tcc = new TorznabCapabilitiesCategories();

            TestCategories.AddTestCategories(tcc);
            return(tcc);
        }
Ejemplo n.º 2
0
        public void TestTorznabCapsCategories()
        {
            var torznabCaps = new TorznabCapabilities();

            TestCategories.AddTestCategories(torznabCaps.Categories);

            // test Torznab caps (XML) => more in Common.Model.TorznabCapabilitiesTests
            var xDocument           = torznabCaps.GetXDocument();
            var xDocumentCategories = xDocument.Root?.Element("categories")?.Elements("category").ToList();

            Assert.AreEqual(7, xDocumentCategories?.Count);
            Assert.AreEqual("100044", xDocumentCategories?[0].Attribute("id")?.Value);
            Assert.AreEqual("100045", xDocumentCategories?[1].Attribute("id")?.Value);
            Assert.AreEqual("1030", xDocumentCategories?[2].Attribute("id")?.Value);
            Assert.AreEqual("1040", xDocumentCategories?[3].Attribute("id")?.Value);
            Assert.AreEqual("2000", xDocumentCategories?[4].Attribute("id")?.Value); // Movies
            Assert.AreEqual("2030", xDocumentCategories?[5].Attribute("id")?.Value);
            Assert.AreEqual("7030", xDocumentCategories?[6].Attribute("id")?.Value);
            Assert.AreEqual(9, xDocumentCategories?[4]?.Elements("subcat").ToList().Count); // Movies
        }