ExpressionToCode

screenshot of ExpressionToCode

Generates valid, readable C# from an Expression Tree.

Overview

ExpressionToCode is a tool that generates valid and readable C# code from an Expression Tree. It provides a feature similar to Groovy's Power Assert, offering detailed information about failing assertions in unit testing frameworks like NUnit or xUnit.NET.

Features

  • Generates valid C# code from Expression Trees
  • Supports more operators and syntax elements than Power Assert.NET
  • Configurable output for different scenarios like small values or sequences
  • Recognizes various types of expressions including lambdas, field access, and property access
  • Maintains Visual Studio spacing rules by default
  • Supports nested Lambdas and C# syntactic sugar for object initializers

Summary

ExpressionToCode is a powerful tool for generating valid and readable C# code from Expression Trees. It offers a detailed insight into failing assertions and supports a wide range of C# syntax elements and operators. With configurable output options and support for various expression types, ExpressionToCode is a valuable asset for developers working with unit testing frameworks in C#.