/// <summary>
        /// Returns Code contract based preconditions only for specified <paramref name="functionDeclaration"/>.
        /// </summary>
        public static IEnumerable <ContractRequires> GetRequires(this ICSharpFunctionDeclaration functionDeclaration)
        {
            Contract.Requires(functionDeclaration != null);
            Contract.Ensures(Contract.Result <IEnumerable <ContractRequires> >() != null);

            return(functionDeclaration.GetPreconditions().OfType <ContractRequires>());
        }
 private bool IsArgumentAlreadyVerifiedByPrecondition(
     ICSharpFunctionDeclaration functionDeclaration, string parameterName)
 {
     return(functionDeclaration.GetPreconditions()
            .Any(p => p.ChecksForNotNull(parameterName)));
 }