示例#1
0
        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());
        }
示例#2
0
        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>());
        }
示例#3
0
        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>();
            });
        }
示例#4
0
        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();
            });
        }