Ejemplo n.º 1
0
 private static void CheckResultIsCompatibleWithCall(IReturn valueToReturn, ICallSpecification spec)
 {
     var requiredReturnType = spec.ReturnType();
     if (!valueToReturn.CanBeAssignedTo(requiredReturnType))
     {
         throw new CouldNotSetReturnDueToTypeMismatchException(valueToReturn.TypeOrNull(), spec.GetMethodInfo());
     }
 }
Ejemplo n.º 2
0
        private static void CheckResultIsCompatibleWithCall(IReturn valueToReturn, ICallSpecification spec)
        {
            var requiredReturnType = spec.ReturnType();

            if (!valueToReturn.CanBeAssignedTo(requiredReturnType))
            {
                throw new CouldNotSetReturnDueToTypeMismatchException(valueToReturn.TypeOrNull(), spec.GetMethodInfo());
            }
        }
 public static string DiagName(this ICallSpecification argSpec)
 {
     return($"<{argSpec} Signature: {argSpec.GetMethodInfo().DiagName()}>");
 }