Ejemplo n.º 1
0
        public void Initialization_StaticMethodRequiresNullTarget()
        {
            var method = ReflectionObjectMother.GetSomeStaticMethod();
            var target = ExpressionTreeObjectMother.GetSomeExpression(method.DeclaringType);

            new NewDelegateExpression(typeof(Action), target, method);
        }
Ejemplo n.º 2
0
 public void CallBase_StaticMethodInfo()
 {
     Assert.That(
         () => _context.CallBase(ReflectionObjectMother.GetSomeStaticMethod()),
         Throws.ArgumentException
         .With.ArgumentExceptionMessageEqualTo(
             "Cannot perform base call for static method.", "baseMethod"));
 }
        public void Initialization_StaticMethodRequiresNullTarget()
        {
            var method = ReflectionObjectMother.GetSomeStaticMethod();
            var target = ExpressionTreeObjectMother.GetSomeExpression(method.DeclaringType);

            Assert.That(
                () => new NewDelegateExpression(typeof(Action), target, method),
                Throws.ArgumentException
                .With.ArgumentExceptionMessageEqualTo(
                    "Static method must not have target.", "target"));
        }
Ejemplo n.º 4
0
 public void CallBase_StaticMethodInfo()
 {
     _context.CallBase(ReflectionObjectMother.GetSomeStaticMethod());
 }