Пример #1
0
        public static string ConvertMockExpressionToString(Expression expr)
        {
            string result = expr.Type.ToString();

            var replacer = new ClosureWithSafeParameterReplacer();
            var lambda   = expr as LambdaExpression;

            if (lambda != null)
            {
                expr = lambda.Body;
            }
            expr = replacer.Visit(expr);
            var cleanedExpr = MakeVoidLambda(expr, replacer.Parameters);

            result = cleanedExpr.ToString();
            result = replacer.CleanExpressionString(result);

            return(result);
        }
Пример #2
0
		public static string ConvertMockExpressionToString(Expression expr)
		{
			string result = expr.Type.ToString();

			var replacer = new ClosureWithSafeParameterReplacer();
			var lambda = expr as LambdaExpression;
			if (lambda != null)
				expr = lambda.Body;
			expr = replacer.Visit(expr);
			var cleanedExpr = MakeVoidLambda(expr, replacer.Parameters);

			result = cleanedExpr.ToString();
			result = replacer.CleanExpressionString(result);

			return result;
		}