public void TargetReturnsValueType_DelegateReturnsDifferentValueType_ThrowsException()
        {
            var instance = new ObscenelyAnnoyingClass();
            int arg      = 42;

            var methodToInvoke = MethodReference.Get(() => instance.ReturnInputInt(arg));

            // Throws
            Assert.ThrowsAny <Exception>(() =>
                                         MethodBuilder <Func <object, int, double> >
                                         .Start(_moduleVersionId, methodToInvoke.MetadataToken, (int)OpCodeValue.Callvirt, "ReturnInputInt")
                                         .WithConcreteType(typeof(ObscenelyAnnoyingClass))
                                         .WithParameters(arg)
                                         .Build());
        }
        public void TargetReturnsValueType_DelegateReturnsObject_IsOk()
        {
            var instance = new ObscenelyAnnoyingClass();
            int arg      = 42;

            var methodToInvoke = MethodReference.Get(() => instance.ReturnInputInt(arg));
            var methodCall     = MethodBuilder <Func <object, int, object> >
                                 .Start(_moduleVersionId, methodToInvoke.MetadataToken, (int)OpCodeValue.Callvirt, "ReturnInputInt")
                                 .WithConcreteType(typeof(ObscenelyAnnoyingClass))
                                 .WithParameters(arg)
                                 .Build();

            var actual = methodCall(instance, arg);

            Assert.Equal(arg, actual);
        }