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