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)); }
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)); }
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); }
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); }