Exemple #1
0
        public static IPrecondition TryCreatePrecondition(ICSharpStatement statement)
        {
            var ifThrowPrecondition = IfThrowPrecondition.TryCreate(statement);

            if (ifThrowPrecondition != null)
            {
                return(ifThrowPrecondition);
            }

            var requires = CodeContractAssertion.TryCreate(statement) as IPrecondition;

            if (requires != null)
            {
                return(requires);
            }

            return(null);
        }
Exemple #2
0
 public static CodeContractAssertion TryCreateAssertion(IInvocationExpression invocationExpression)
 {
     return(CodeContractAssertion.FromInvocationExpression(invocationExpression));
 }
Exemple #3
0
 public static CodeContractAssertion TryCreateAssertion(ICSharpStatement statement)
 {
     return(CodeContractAssertion.TryCreate(statement));
 }