Exemplo n.º 1
0
        public void IsFalse_False()
        {
            DynamicMethod   method = new DynamicMethod("temp", typeof(int), Type.EmptyTypes);
            MethodGenerator g      = new MethodGenerator(method);

            g.Load(true);
            g.Compare(LogicOperator.IsFalse);
            g.Return();
            int result = (int)method.Invoke(null, new object[] { });

            Assert.AreEqual(0, result);
        }
Exemplo n.º 2
0
        public void NotEqual_True()
        {
            DynamicMethod   method = new DynamicMethod("temp", typeof(int), Type.EmptyTypes);
            MethodGenerator g      = new MethodGenerator(method);

            g.Load(2);
            g.Load(3);
            g.Compare(LogicOperator.AreNotEqual);
            g.Return();
            int result = (int)method.Invoke(null, new object[] { });

            Assert.AreEqual(1, result);
        }