public void EmitCall_MethodInfo_BaseConstructorMethodInfo_WithOptionalParameters() { var methodInfo = new ConstructorAsMethodInfoAdapter(ReflectionObjectMother.GetSomeDefaultConstructor()); Assert.That( () => _decorator.EmitCall(OpCodes.Call, methodInfo, new[] { ReflectionObjectMother.GetSomeType() }), Throws.ArgumentException .With.ArgumentExceptionMessageEqualTo("Constructor calls cannot have optional parameters.", "optionalParameterTypes")); }
public void EmitCall_MethodInfo_BaseConstructorMethodInfo_WithOptionalParameters() { var methodInfo = new ConstructorAsMethodInfoAdapter(ReflectionObjectMother.GetSomeDefaultConstructor()); _decorator.EmitCall(OpCodes.Call, methodInfo, new[] { ReflectionObjectMother.GetSomeType() }); }