示例#1
0
        public void TestAbstractNotPossible3()
        {
            var  rules   = new WordGenericRules();
            bool newRule = rules.AbstractGenericRule("CONSTANT1 xyz", "xyz", "CONSTANT2 abc", "abc", string.Empty);

            Assert.IsFalse(newRule);
        }
示例#2
0
        public void TestAbstractAndApplyRuleCompound()
        {
            var  rules   = new WordGenericRules();
            bool newRule = rules.AbstractGenericRule("CONSTANT ab cde", "cdeab", "CONSTANT xyz ab", "abxyz", string.Empty);

            Assert.IsTrue(newRule);
            string output = rules.ApplyMatchingRule("CONSTANT 1234 5");

            Assert.AreEqual("51234", output);
        }
示例#3
0
        public void TestAbstractAndApplyRule1()
        {
            var  rules   = new WordGenericRules();
            bool newRule = rules.AbstractGenericRule("CONSTANT xyz", "xyz", "CONSTANT ab", "ab", string.Empty);

            Assert.IsTrue(newRule);
            string output = rules.ApplyMatchingRule("CONSTANT bkjf");

            Assert.AreEqual("bkjf", output);
        }