Пример #1
0
        public void TestCaseEvaluationExceptions()
        {
            var @operator = new RelationalLowerThanOperator(TypeConverter);

            ExpectArgumentNullException("context", () => @operator.Evaluate(null, 1, 2));
            ExpectArgumentNullException("context", () => @operator.EvaluateLhs(null, 1, out object dummy));
        }
Пример #2
0
        public void TestCaseConstruction2()
        {
            var @operator = new RelationalLowerThanOperator(TypeConverter);

            Assert.AreEqual("<", @operator.Symbol);
            Assert.AreEqual(StringComparer.CurrentCulture, @operator.StringComparer);
        }
Пример #3
0
        public void TestCaseEvaluation()
        {
            var @operator = new RelationalLowerThanOperator(StringComparer.Ordinal, TypeConverter);

            AssertEvaluation(@operator, long.MaxValue, long.MaxValue, false);
            AssertEvaluation(@operator, long.MinValue, 0, true);
            AssertEvaluation(@operator, -0.5, -0.5, false);
            AssertEvaluation(@operator, 3.33, 3.34, true);
        }
Пример #4
0
        public void TestCaseConstruction3()
        {
            var @operator = new RelationalLowerThanOperator("operator", StringComparer.Ordinal, TypeConverter);

            Assert.AreEqual("operator", @operator.Symbol);
            Assert.AreEqual(6, @operator.Precedence);
            Assert.AreEqual(Associativity.LeftToRight, @operator.Associativity);
            Assert.AreEqual(StringComparer.Ordinal, @operator.StringComparer);
        }