ExpressionTreeTestObjects 1.0.23

dotnet add package ExpressionTreeTestObjects --version 1.0.23
NuGet\Install-Package ExpressionTreeTestObjects -Version 1.0.23
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ExpressionTreeTestObjects" Version="1.0.23" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ExpressionTreeTestObjects --version 1.0.23
#r "nuget: ExpressionTreeTestObjects, 1.0.23"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ExpressionTreeTestObjects as a Cake Addin
#addin nuget:?package=ExpressionTreeTestObjects&version=1.0.23

// Install ExpressionTreeTestObjects as a Cake Tool
#tool nuget:?package=ExpressionTreeTestObjects&version=1.0.23

NuGet TestObjects Status

Expression trees (and related objects) can be generated in three ways:

  • Calling the factory methods at System.Linq.Expressions.Expression
  • In C#, assigning a lambda expression to an Expression<T> variable, parameter or property; the C# compiler generates an expression tree corresponding to the code of the lambda expression
  • The VB compiler also generates expression trees from VB lambda expressions assigned to Expression<T>.

As part of the development of ExpressionTreeToString, I needed a comprehensive set of expression trees to test the renderers against. This set of objects is available as a Nuget package.

Each expression object is a field with the TestObject attribute applied to it.

The objects are available by referencing the NuGet package, and calling the static Get method:

// using ExpressionTreeTestObjects;

(string category, string source, string name, object o)[] lst = Objects.Get();

where source is the type where the object is defined -- one of the following:

Source Description
Factory methods Factory methods
CSCompiler C# compiler
VBCompiler VB compiler

and category is one of these values:

  • Binary
  • Blocks
  • Conditionals
  • Constants
  • DebugInfos
  • Defaults
  • Dynamics
  • Gotos
  • Indexer
  • Invocation
  • Labels
  • Lambda
  • Literal
  • Loops
  • Member access (+ closed variables)
  • Member bindings
  • Method call
  • New array
  • Object creation and initialization
  • Quoted
  • Runtime variables
  • Switch, CatchBlock
  • Try, Catch, Finally
  • Type check
  • Unary

The static constructor automatically loads types in assemblies that start with ExpressionTreeTestObjects -- ExpressionTreeTestObjects.CSharp.dll, and ExpressionTreeTestObjects.VB.dll.

  1. Call the static LoadType method on the containing type:


    and it will add the object. The type name becomes the source, and the field name becomes the objectName.

The C# and VB compiler test expressions were added as I was working on the corresponding renderers. For the factory methods, I used reflection to build a list of all the methods and overloads at System.Linq.Expressions.Expression and created expressions by calling each one.

The result is pretty comprehensive, with one limitation: I didn't write test expressions for overloads which take an additional MethodInfo, like this one. This is being tracked at #20.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.1

    • No dependencies.
  • .NETFramework 4.5.2

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on ExpressionTreeTestObjects:

Repository Stars
Debugging visualizer for expression trees
Version Downloads Last updated
1.0.23 420 12/23/2021
1.0.22 275 12/14/2021
1.0.21 590 6/6/2021
1.0.20 351 5/31/2021
1.0.19 436 1/16/2021
1.0.18 521 12/6/2020
1.0.17 501 12/5/2020
1.0.14 430 10/8/2020
1.0.13 468 9/23/2020
1.0.12 466 9/16/2020
1.0.11 448 9/14/2020
1.0.10 499 8/31/2020
1.0.9 422 8/24/2020
1.0.8 449 8/18/2020
1.0.7 437 8/5/2020
1.0.6 478 7/19/2020
1.0.5 3,779 7/19/2020
1.0.4 425 7/16/2020
1.0.3 561 6/27/2020
1.0.2 648 3/29/2020
1.0.1 596 12/18/2019
1.0.0 513 12/18/2019