示例#1
0
 static CodeStatement SetFailureIfNull(CodeExpression expr)
 {
     return(new CodeConditionStatement(Easy.Binary(expr,
                                                   CodeBinaryOperatorType.IdentityInequality,
                                                   Easy.Null),
                                       new CodeSnippetStatement("\t\t\t\treturn SetFailure();")));
 }
示例#2
0
 static CodeStatement AssertIsNotNull(CodeExpression expr)
 {
     return(new CodeExpressionStatement(
                Easy.Type("Debug").InvokeMethod("Assert",
                                                Easy.Binary(expr,
                                                            CodeBinaryOperatorType.IdentityInequality,
                                                            Easy.Null))
                ));
 }
示例#3
0
        static CodeStatement IfNullSetFailure(CodeExpression expr)
        {
            var condition = Easy.Binary(expr, CodeBinaryOperatorType.IdentityEquality, Easy.Null);

            return(new CodeConditionStatement(condition, new CodeSnippetStatement("\t\t\t\treturn SetFailure();")));
        }