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"));
        }
示例#2
0
        public void EmitCall_MethodInfo_BaseConstructorMethodInfo_WithOptionalParameters()
        {
            var methodInfo = new ConstructorAsMethodInfoAdapter(ReflectionObjectMother.GetSomeDefaultConstructor());

            _decorator.EmitCall(OpCodes.Call, methodInfo, new[] { ReflectionObjectMother.GetSomeType() });
        }