public static int MainMethod() { dynamic dy = new MemberClass(); MyTest mt = new MyTest(); dynamic d = mt; decimal dec = 0M; try { float result = (float)dy.Method_ReturnsFloatNegConstraint <Test, dynamic, DerivedMyTest>(null, d, d, ref dec); } catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException e) { if (!ErrorVerifier.Verify(ErrorMessageId.GenericConstraintNotSatisfiedRefType, e.Message, "MemberClass.Method_ReturnsFloatNegConstraint<T,U,V>(T, object, U, ref decimal)", "I", "U", "object")) { return(1); } } return(0); }