static CodeStatement SetFailureIfNull(CodeExpression expr) { return(new CodeConditionStatement(Easy.Binary(expr, CodeBinaryOperatorType.IdentityInequality, Easy.Null), new CodeSnippetStatement("\t\t\t\treturn SetFailure();"))); }
static CodeStatement AssertIsNotNull(CodeExpression expr) { return(new CodeExpressionStatement( Easy.Type("Debug").InvokeMethod("Assert", Easy.Binary(expr, CodeBinaryOperatorType.IdentityInequality, Easy.Null)) )); }
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();"))); }