Beispiel #1
0
        public void TestCaseConstruction3()
        {
            var @operator = new BitwiseNotOperator("operator", TypeConverter);

            Assert.AreEqual("operator", @operator.Symbol);
            Assert.AreEqual(1, @operator.Precedence);
        }
 public static BitwiseEvaluationStatement CreateNot(BitwiseNotOperator op, EvaluationStatement operand,
                                                    StatementInfo info, IStatement parentStatement = null)
 {
     return(new BitwiseEvaluationStatement(null, op, operand, info)
     {
         ParentStatement = parentStatement
     });
 }
Beispiel #3
0
        public void TestCaseEvaluation()
        {
            var @operator = new BitwiseNotOperator(TypeConverter);

            AssertEvaluation <int>(@operator, 1, ~1);
            AssertEvaluation <int>(@operator, 0, ~0);
            AssertEvaluation <int>(@operator, int.MinValue, ~int.MinValue);
        }
Beispiel #4
0
        public void TestCaseEvaluationExceptions()
        {
            var @operator = new BitwiseNotOperator(TypeConverter);

            ExpectArgumentNullException("context", () => @operator.Evaluate(null, 1));
        }
Beispiel #5
0
        public void TestCaseConstruction2()
        {
            var @operator = new BitwiseNotOperator(TypeConverter);

            Assert.AreEqual("~", @operator.Symbol);
        }