Example #1
0
        private IndexerResource GetNewznabSchemav3(string name = null)
        {
            var schema = Indexersv3.Schema().First(v => v.Implementation == "Newznab");

            schema.Name         = name;
            schema.EnableRss    = false;
            schema.EnableSearch = false;

            return(schema);
        }
Example #2
0
        public void v3_categories_should_accept_array()
        {
            var schema = GetNewznabSchemav3("Testv3array");

            var categoriesField = GetCategoriesField(schema);

            categoriesField.Value = new object[] { 1000, 1010 };

            var result = Indexersv3.Post(schema);

            var resultArray = GetCategoriesField(result).Value;

            resultArray.Should().BeOfType <JArray>();
            resultArray.As <JArray>().ToObject <int[]>().Should().BeEquivalentTo(new[] { 1000, 1010 });
        }
Example #3
0
        public void v3_categories_should_accept_emptystring()
        {
            var schema = GetNewznabSchemav3("Testv3emptystring");

            var categoriesField = GetCategoriesField(schema);

            categoriesField.Value = "";

            var result = Indexersv3.Post(schema);

            var resultArray = GetCategoriesField(result).Value;

            resultArray.Should().BeOfType <JArray>();
            resultArray.As <JArray>().Should().BeEmpty();
        }