Пример #1
0
 public void ApplyModifierResultConcatPrefix()
 {
     StringMatch resultMatch = new StringMatch (" Gomez ", " German ");
     Hashtable parameters = new Hashtable ();
     parameters ["prefix"] = "Juan";
     Modifier concat = new Modifier ("Concat", parameters);
     Assert.AreEqual ("Juan German ", resultMatch.ApplyModifier (resultMatch.ResultMatch, concat));
 }
Пример #2
0
 public void ApplyModifierFullConcatPostfix()
 {
     StringMatch fullMatch = new StringMatch (" Gomez ", "");
     Hashtable parameters = new Hashtable ();
     parameters ["postfix"] = "Morales";
     Modifier concat = new Modifier ("Concat", parameters);
     Assert.AreEqual (" Gomez Morales", fullMatch.ApplyModifier (fullMatch.FullMatch, concat));
 }
Пример #3
0
 public void ApplyModifiersFull()
 {
     StringMatch fullMatch = new StringMatch (" Gomez ", "");
     Hashtable parameters = new Hashtable ();
     parameters ["prefix"] = "Hector";
     parameters ["postfix"] = "Morales";
     Modifier trim = new Modifier ("Trim", null);
     Modifier concat = new Modifier ("Concat", parameters);
     Modifier [] modifiers = {trim, concat};
     Assert.AreEqual ("HectorGomezMorales", fullMatch.ApplyModifiers (modifiers, RuleType.FULL));
 }
Пример #4
0
 public void ApplyModifierResultTrim()
 {
     StringMatch resultMatch = new StringMatch ("\nFoo    ", "\n\n    Bar    \n");
     Modifier trim = new Modifier ("Trim", null);
     Assert.AreEqual ("Bar", resultMatch.ApplyModifier (resultMatch.ResultMatch, trim));
 }
Пример #5
0
 public void ApplyModifierFullTrim()
 {
     StringMatch fullMatch = new StringMatch ("\nFoo    ", "");
     Modifier trim = new Modifier ("Trim", null);
     Assert.AreEqual ("Foo", fullMatch.ApplyModifier (fullMatch.FullMatch, trim));
 }
Пример #6
0
 public void HasResultMatch()
 {
     StringMatch fullMatch = new StringMatch ("Foo", "");
     StringMatch resultMatch = new StringMatch ("Foo", "Bar");
     Assert.AreEqual(false, fullMatch.HasResultMatch (), "HRM01");
     Assert.AreEqual(true, resultMatch.HasResultMatch (), "HRM02");
 }
Пример #7
0
 public void ApplyModifiersResult2()
 {
     StringMatch fullMatch = new StringMatch (" Gomez ", " German ");
     Hashtable parameters = new Hashtable ();
     parameters ["prefix"] = "         Juan";
     parameters ["postfix"] = "Castañeda\n  \n";
     Modifier trim = new Modifier ("Trim", null);
     Modifier concat = new Modifier ("Concat", parameters);
     Modifier [] modifiers = {concat, trim};
     Assert.AreEqual ("Juan German Castañeda", fullMatch.ApplyModifiers (modifiers, RuleType.RESULT));
 }
Пример #8
0
 public void ApplyModifiersFullConcatPrefix()
 {
     StringMatch fullMatch = new StringMatch (" Gomez ", "");
     Hashtable parameters = new Hashtable ();
     parameters ["prefix"] = "Hector";
     Modifier concat = new Modifier ("Concat", parameters);
     Assert.AreEqual ("Hector Gomez ", fullMatch.ApplyModifier (fullMatch.FullMatch, concat));
 }