public void ToString_TextArgument_ReturnsExpected() { var function = new EndsWith(); function.AddArgument(new HypnoGreen.Types.Text("denmark")); function.AddArgument(new HypnoGreen.Types.Text("ark")); Assert.AreEqual("EndsWith(\"denmark\", \"ark\")", function.ToString()); }
public void Evaluate_TextAndText_ReturnsFalse(string text, string substring) { var endsWith = new EndsWith(); endsWith.AddArgument(new HypnoGreen.Types.Text(text)); endsWith.AddArgument(new HypnoGreen.Types.Text(substring)); Assert.False(endsWith.EvaluateWithData <bool>()); }
public void Evaluate_NullAndText_ReturnsFalse() { var endsWith = new EndsWith(); endsWith.AddArgument(Null.Instance); endsWith.AddArgument(new HypnoGreen.Types.Text("denmark")); Assert.Throws <InvalidOperationException>(() => { endsWith.EvaluateWithData(); }); }