예제 #1
0
        public void NumberEqualsCanThrow()
        {
            Operator op = new EqualsOperator().NumberEquals;

            MeVariable[] arr = { new MeStruct(""), new MeNumber(10) };
            Assert.IsFalse(op.CanExecute(arr));
            TestUtils.CustomExceptionTest(() => op.Execute(arr), typeof(MeContextException));
        }
예제 #2
0
        public void StringEqualsCanThrow()
        {
            Operator op         = new EqualsOperator().NumberEquals;
            string   testString = "TEST";

            MeVariable[] arr = { new MeStruct(testString), new MeString(testString) };
            Assert.IsFalse(op.CanExecute(arr));
            TestUtils.CustomExceptionTest(() => op.Execute(arr), typeof(MeContextException));
        }
예제 #3
0
        public void StringEqualsCanCompare()
        {
            Operator op         = new EqualsOperator().StringEquals;
            string   testString = "TEST_STR";

            MeVariable[] arr = { new MeString(testString), new MeString(testString) };
            Assert.IsTrue(op.CanExecute(arr));
            bool result = op.Execute(arr).Get <bool>();

            Assert.IsTrue(result);
        }
예제 #4
0
        public void NumberEqualsCanCompare()
        {
            Operator op         = new EqualsOperator().NumberEquals;
            float    testNumber = 1337.0f;

            MeVariable[] arr = { new MeNumber(testNumber), new MeNumber(testNumber) };
            Assert.IsTrue(op.CanExecute(arr));
            bool result = op.Execute(arr).Get <bool>();

            Assert.IsTrue(result);
        }