Skip to content

Commit

Permalink
Merge cleaned-up ExpressionStringBuilder into `StringBuilderExtensi…
Browse files Browse the repository at this point in the history
…ons` (devlooped#882)

* Convert `ExpressionStringBuilder` to extension methods
* Chain `StringBuilder` operations
* General-purpose `AppendCommaSeparated` method reduces code duplication
* Inline a few one-line methods
* Simplify enclosed comma-separated lists code pattern
* Refactor more existing code to use `AppendCommaSeparated`
* Use more regular method names
* Merge into `StringBuilderExtensions`
   ... after ensuring that the (previous) `ExpressionStringBuilder` code
   file only contains `AppendExpression` methods at the top level (every-
   thing else is turned into local functions).
* Inline event add/remove formatting code
  • Loading branch information
stakx authored and ishimko committed Sep 2, 2019
1 parent c72d591 commit 37265ca
Show file tree
Hide file tree
Showing 8 changed files with 568 additions and 729 deletions.
4 changes: 2 additions & 2 deletions src/Moq/ExpressionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Text;

using Moq.Properties;
using Moq.Protected;
Expand Down Expand Up @@ -419,7 +419,7 @@ private static bool PartialMatcherAwareEval_ShouldEvaluate(Expression expression
/// </devdoc>
public static string ToStringFixed(this Expression expression)
{
return new ExpressionStringBuilder().Append(expression).ToString();
return new StringBuilder().AppendExpression(expression).ToString();
}
}
}
Loading

0 comments on commit 37265ca

Please sign in to comment.