public void Initialization_StaticMethodRequiresNullTarget() { var method = ReflectionObjectMother.GetSomeStaticMethod(); var target = ExpressionTreeObjectMother.GetSomeExpression(method.DeclaringType); new NewDelegateExpression(typeof(Action), target, method); }
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")); }
public void CallBase_StaticMethodInfo() { _context.CallBase(ReflectionObjectMother.GetSomeStaticMethod()); }