Ejemplo n.º 1
0
        public void ParsePathArgs()
        {
            string    ruleText = @"arg0='La',arg1path='Foo'";
            MatchRule rule     = MatchRule.Parse(ruleText);

            Assert.AreEqual(ruleText, rule.ToString());
        }
Ejemplo n.º 2
0
        public void CanonicalOrdering()
        {
            string    ruleText       = @"arg0='La',arg5path='/bar',arg2='Fa',destination='org.ndesk.Recipient',interface='org.ndesk.ITest',arg1path='/foo'";
            string    sortedRuleText = @"interface='org.ndesk.ITest',destination='org.ndesk.Recipient',arg0='La',arg1path='/foo',arg2='Fa',arg5path='/bar'";
            MatchRule rule           = MatchRule.Parse(ruleText);

            Assert.AreEqual(4, rule.Args.Count);
            Assert.AreEqual(sortedRuleText, rule.ToString());
        }
Ejemplo n.º 3
0
        public void Parse()
        {
            string    ruleText = @"member='Lala'";
            MatchRule rule     = MatchRule.Parse(ruleText);

            Assert.AreEqual(null, rule.MessageType);
            Assert.AreEqual(0, rule.Args.Count);
            Assert.AreEqual(ruleText, rule.ToString());
        }
Ejemplo n.º 4
0
        public void ParseArgs()
        {
            string    ruleText = @"arg5='F,o\'o\\\'\\',arg8=''";
            MatchRule rule     = MatchRule.Parse(ruleText);

            Assert.AreEqual(null, rule.MessageType);
            Assert.AreEqual(2, rule.Args.Count);

            //Assert.AreEqual (@"F,o'o\'\", rule.Args[5].Value);
            //Assert.AreEqual (@"", rule.Args[8].Value);

            Assert.AreEqual(ruleText, rule.ToString());
        }