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)); }
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)); }
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)); }
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)); }
public void ApplyModifierFullTrim() { StringMatch fullMatch = new StringMatch ("\nFoo ", ""); Modifier trim = new Modifier ("Trim", null); Assert.AreEqual ("Foo", fullMatch.ApplyModifier (fullMatch.FullMatch, trim)); }
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"); }
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)); }
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)); }