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