예제 #1
0
        public void AddRuleRangeTest()
        {
            RuleSet rules = RuleSet.FromDirectory(Path.Combine("rules", "valid"), null);

            // Add Range
            RuleSet testRules = new RuleSet();

            testRules.AddRange(rules.ByLanguages(new string[] { "javascript" }));
            Assert.IsTrue(testRules.Count() > 0, "AddRange testRules is empty");

            // Add Rule
            testRules = new RuleSet();
            IEnumerable <Rule> list = rules.ByLanguages(new string[] { "javascript" });

            foreach (Rule r in list)
            {
                testRules.AddRule(r);
            }

            Assert.IsTrue(testRules.Count() > 0, "AddRule testRules is empty");
        }