示例#1
0
        public void ToString_TextArgument_ReturnsExpected()
        {
            var function = new Matches();

            function.AddArgument(new HypnoGreen.Types.Text("denmark"));
            function.AddArgument(new RegExp("[A-Za-z]+"));
            Assert.AreEqual("Matches(\"denmark\", /[A-Za-z]+/)", function.ToString());
        }
示例#2
0
        public void Evaluate_TextAndText_ReturnsFalse(string text, string regex)
        {
            var matches = new Matches();

            matches.AddArgument(new HypnoGreen.Types.Text(text));
            matches.AddArgument(new RegExp(regex));
            Assert.False(matches.EvaluateWithData <bool>());
        }
示例#3
0
        public void Evaluate_NullAndText_ReturnsFalse()
        {
            var matches = new Matches();

            matches.AddArgument(Null.Instance);
            matches.AddArgument(new RegExp("denmark"));
            Assert.Throws <InvalidOperationException>(() =>
            {
                matches.EvaluateWithData();
            });
        }
示例#4
0
        public void Evaluate_TextAndNull_ReturnsFalse()
        {
            var matches = new Matches();

            matches.AddArgument(new HypnoGreen.Types.Text("denmark"));
            matches.AddArgument(Null.Instance);
            Assert.Throws <InvalidOperationException>(() =>
            {
                matches.EvaluateWithData();
            });
        }