public void Execute_TextToLastChars_Valid(string value, int length, string expected) { var function = new TextToLastChars(new LiteralScalarResolver <int>(length)); var result = function.Evaluate(value); Assert.That(result, Is.EqualTo(expected)); }
public void Execute_TextToLastCharsWithVariable_Valid() { var args = new GlobalVariableScalarResolverArgs("length", new Dictionary <string, ITestVariable>() { { "length", new GlobalVariable(new LiteralScalarResolver <int>(6)) } }); var function = new TextToLastChars(new GlobalVariableScalarResolver <int>(args)); var result = function.Evaluate("123456789"); Assert.That(result, Is.EqualTo("456789")); }