Skip to content

Add tests for .NET 10 #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions DelegateDecompiler.sln
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DelegateDecompiler.EntityFr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DelegateDecompiler.EntityFrameworkCore9.Tests", "src\DelegateDecompiler.EntityFrameworkCore9.Tests\DelegateDecompiler.EntityFrameworkCore9.Tests.csproj", "{1E051041-B9CB-44AC-B2A2-5D4A4B91B2DB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DelegateDecompiler.EntityFrameworkCore10.Tests", "src\DelegateDecompiler.EntityFrameworkCore10.Tests\DelegateDecompiler.EntityFrameworkCore10.Tests.csproj", "{5C3905CC-6B38-4C95-80FC-0DB5B72C5ABD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -77,6 +79,10 @@ Global
{1E051041-B9CB-44AC-B2A2-5D4A4B91B2DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E051041-B9CB-44AC-B2A2-5D4A4B91B2DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E051041-B9CB-44AC-B2A2-5D4A4B91B2DB}.Release|Any CPU.Build.0 = Release|Any CPU
{5C3905CC-6B38-4C95-80FC-0DB5B72C5ABD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C3905CC-6B38-4C95-80FC-0DB5B72C5ABD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C3905CC-6B38-4C95-80FC-0DB5B72C5ABD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C3905CC-6B38-4C95-80FC-0DB5B72C5ABD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
3 changes: 3 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ environment:

init:
- net start MSSQL$SQL2019
- ps: |
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1"
& $env:temp\dotnet-install.ps1 -Channel 10.0 -Quality preview -InstallDir "$env:ProgramFiles\dotnet"

build_script:
- build.cmd
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "9.0.100",
"version": "10.0.100-preview.1.25120.13",
"rollForward": "latestFeature"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Copyright>Copyright © Dave Glick 2014, Jon Smith 2014, Alexander Zaytsev 2014 - 2024</Copyright>
<DefineConstants>$(DefineConstants);EF_CORE;EF_CORE3;EF_CORE5</DefineConstants>
<RootNamespace>DelegateDecompiler.EntityFramework.Tests</RootNamespace>
</PropertyGroup>


<ItemGroup>
<Compile Include="..\DelegateDecompiler.EntityFramework.Tests\**\*.cs" Exclude="..\DelegateDecompiler.EntityFramework.Tests\obj\**">
<Link>%(Name)</Link>
</Compile>
</ItemGroup>

<ItemGroup>
<Compile Include="..\DelegateDecompiler.EntityFrameworkCore.Tests\**\*.cs" Exclude="..\DelegateDecompiler.EntityFrameworkCore.Tests\obj\**">
<Link>%(Name)</Link>
</Compile>
</ItemGroup>

<ItemGroup>
<Compile Remove="..\DelegateDecompiler.EntityFramework.Tests\EntityTypeConfigurationExtensionsTests.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.0-preview.1.25081.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.0-preview.1.25081.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit.Analyzers" Version="4.2.0" PrivateAssets="all" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.0-preview.1.25080.5" />
</ItemGroup>

<ItemGroup>
<None Include="..\DelegateDecompiler.EntityFramework.Tests\App.config" Link="App.config" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\DelegateDecompiler.EntityFrameworkCore5\DelegateDecompiler.EntityFrameworkCore5.csproj" />
<ProjectReference Include="..\DelegateDecompiler.Tests\DelegateDecompiler.Tests.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
Detail of supported commands
============
## Documentation produced for DelegateDecompiler, version 0.34.3.0 on Wednesday, 05 March 2025 18:24

This file documents what linq commands **DelegateDecompiler** supports when
working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF).
EF has one of the best implementations for converting Linq `IQueryable<>` commands into database
access commands, in EF's case T-SQL. Therefore it is a good candidate for using in our tests.

This documentation was produced by compaired direct EF Linq queries against the same query implemented
as a DelegateDecompiler's `Computed` properties. This produces a Supported/Not Supported flag
on each command type tested. Tests are groups and ordered to try and make finding things
easier.

So, if you want to use DelegateDecompiler and are not sure whether the linq command
you want to use will work then clone this project and write your own tests.
(See [How to add a test](HowToAddMoreTests.md) documentation on how to do this).
If there is a problem then please fork the repository and add your own tests.
That will make it much easier to diagnose your issue.

*Note: The test suite has only recently been set up and has only a handful of tests at the moment.
More will appear as we move forward.*


### Group: Basic Features
#### [Select](../TestGroup05BasicFeatures/Test01Select.cs):
- Supported
* Bool Equals Constant (line 38)
* Bool Equals Static Variable (line 61)
* Int Equals Constant (line 82)
* Select Property Without Computed Attribute (line 103)
* Select Method Without Computed Attribute (line 124)
* Select Abstract Member Over Tph Hierarchy (line 145)
* Select Abstract Member Over Tph Hierarchy After Restricting To Subtype (line 166)
* Select Abstract Member Over Tph Hierarchy With Generic Classes After Restricting To Subtype (line 184)
* Select Abstract Member With Condition On It Over Tph Hierarchy With Generic Classes After Restricting To Subtype (line 212)
* Select Multiple Levels Of Abstract Members Over Tph Hierarchy (line 234)
* Select Select Many (line 256)

#### [Select Async](../TestGroup05BasicFeatures/Test02SelectAsync.cs):
- Supported
* Async (line 43)
* Bool Equals Constant Async (line 83)
* Decompile Upfront Bool Equals Constant Async (line 104)
* Bool Equals Static Variable To Array Async (line 127)
* Int Equals Constant (line 148)

#### [Equals And Not Equals](../TestGroup05BasicFeatures/Test03EqualsAndNotEquals.cs):
- Supported
* Int Equals Constant (line 36)
* Int Equals Static Variable (line 58)
* Int Equals String Length (line 79)
* Int Not Equals String Length (line 100)

#### [Nullable](../TestGroup05BasicFeatures/Test04Nullable.cs):
- Supported
* Property Is Null (line 39)
* Bool Equals Static Variable (line 62)
* Int Equals Constant (line 83)
* Nullable Init (line 104)
* Nullable Add (line 125)

#### [Where](../TestGroup05BasicFeatures/Test05Where.cs):
- Supported
* Where Bool Equals Constant (line 37)
* Where Bool Equals Static Variable (line 60)
* Where Int Equals Constant (line 81)
* Where Filters On Abstract Members Over Tph Hierarchy (line 102)

#### [Single](../TestGroup05BasicFeatures/Test10Single.cs):
- Supported
* Single Int Equals Unique Value (line 42)

#### [Single Async](../TestGroup05BasicFeatures/Test11SingleAsync.cs):
- Supported
* Single Int Equals Unique Value Async (line 48)


### Group: Order Take
#### [Order By](../TestGroup10OrderTake/Test01OrderBy.cs):
- Supported
* Order By Children Count (line 37)
* Order By Children Count Then By String Length (line 59)
* Where Any Children Then Order By Children Count (line 81)

#### [Skip Take](../TestGroup10OrderTake/Test02SkipTake.cs):
- Supported
* Order By Children Count Then Take (line 37)
* Order By Children Count Then Skip And Take (line 59)
* Where Any Children Then Order By Then Skip Take (line 81)


### Group: Quantifier Operators
#### [Any](../TestGroup12QuantifierOperators/Test01Any.cs):
- Supported
* Any Children (line 36)
* Any Children With Filter (line 57)

#### [All](../TestGroup12QuantifierOperators/Test02All.cs):
- Supported
* Singleton All Filter (line 36)
* All Filter On Children Int (line 57)

#### [Contains](../TestGroup12QuantifierOperators/Test03Contains.cs):
- Supported
* String Contains Constant String With Filter (line 37)


### Group: Aggregation
#### [Count](../TestGroup15Aggregation/Test01Count.cs):
- Supported
* Count Children (line 37)
* Count Children With Filter (line 59)
* Count Children With Filter By Closure (line 81)
* Count Children With Filter By External Closure (line 104)
* Count Children With Filter By External Closure2 (line 128)
* Singleton Count Children With Filter (line 150)

#### [Sum](../TestGroup15Aggregation/Test02Sum.cs):
- Supported
* Sum Count In Children Where Children Can Be None (line 61)

#### [Count Async](../TestGroup15Aggregation/Test03CountAsync.cs):
- Supported
* Count Children Async (line 44)
* Count Children With Filter Async (line 66)
* Count Children With Filter By Closure Async (line 88)
* Count Children With Filter By External Closure Async (line 111)
* Count Children With Filter By External Closure2 Async (line 135)
* Singleton Count Children With Filter Async (line 157)


### Group: Types
#### [Strings](../TestGroup50Types/Test01Strings.cs):
- Supported
* Concatenate Person Not Handle Null (line 36)
* Concatenate Person Handle Null (line 57)
* Concatenate Person Handle Name Order (line 80)
* Select Generic Method Person Handle (line 101)
* Filter Generic Method Person Handle (line 119)

#### [DateTime](../TestGroup50Types/Test05DateTime.cs):
- Supported
* DateTime Where Compare With Static Variable (line 39)


### Group: Additional Features
#### [Nested Expressions](../TestGroup90AdditionalFeatures/Test01NestedExpressions.cs):
- Supported
* Subquery As Context Extension Method (line 72)



The End
Loading