Skip to content

Commit b08d8f6

Browse files
authored
Add tests for .NET 10 (#258)
+semver:patch
1 parent 2b05851 commit b08d8f6

12 files changed

+1073
-2
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ dotnet test -c Debug -f net8.0 src/DelegateDecompiler.EntityFramework.Tests
2727
dotnet test -c Debug -f net8.0 src/DelegateDecompiler.EntityFrameworkCore6.Tests
2828
dotnet test -c Debug -f net8.0 src/DelegateDecompiler.EntityFrameworkCore8.Tests
2929
dotnet test -c Debug -f net9.0 src/DelegateDecompiler.EntityFrameworkCore9.Tests
30+
dotnet test -c Debug -f net10.0 src\DelegateDecompiler.EntityFrameworkCore10.Tests
3031
```
3132

3233
Use `-p:DisableGitVersionTask=true` flag to avoid build issues if GitVersion is not set up.

.github/workflows/dotnet-linux.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141

4242
- name: Restore
4343
run: dotnet restore
44+
4445
- name: Patch App.config
4546
run: |
4647
$configPath = 'src/DelegateDecompiler.EntityFramework.Tests/App.config'
@@ -60,3 +61,4 @@ jobs:
6061
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFrameworkCore6.Tests
6162
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFrameworkCore8.Tests
6263
dotnet test --no-build -c Release -f net9.0 src/DelegateDecompiler.EntityFrameworkCore9.Tests
64+
dotnet test --no-build -c Release -f net10.0 src\DelegateDecompiler.EntityFrameworkCore10.Tests

.github/workflows/dotnet-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ jobs:
5555
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFrameworkCore6.Tests
5656
dotnet test --no-build -c Release -f net8.0 src/DelegateDecompiler.EntityFrameworkCore8.Tests
5757
dotnet test --no-build -c Release -f net9.0 src/DelegateDecompiler.EntityFrameworkCore9.Tests
58+
dotnet test --no-build -c Release -f net10.0 src\DelegateDecompiler.EntityFrameworkCore10.Tests

DelegateDecompiler.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DelegateDecompiler.EntityFr
3535
EndProject
3636
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DelegateDecompiler.EntityFrameworkCore9.Tests", "src\DelegateDecompiler.EntityFrameworkCore9.Tests\DelegateDecompiler.EntityFrameworkCore9.Tests.csproj", "{1E051041-B9CB-44AC-B2A2-5D4A4B91B2DB}"
3737
EndProject
38+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DelegateDecompiler.EntityFrameworkCore10.Tests", "src\DelegateDecompiler.EntityFrameworkCore10.Tests\DelegateDecompiler.EntityFrameworkCore10.Tests.csproj", "{5C3905CC-6B38-4C95-80FC-0DB5B72C5ABD}"
39+
EndProject
3840
Global
3941
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4042
Debug|Any CPU = Debug|Any CPU
@@ -77,6 +79,10 @@ Global
7779
{1E051041-B9CB-44AC-B2A2-5D4A4B91B2DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
7880
{1E051041-B9CB-44AC-B2A2-5D4A4B91B2DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
7981
{1E051041-B9CB-44AC-B2A2-5D4A4B91B2DB}.Release|Any CPU.Build.0 = Release|Any CPU
82+
{5C3905CC-6B38-4C95-80FC-0DB5B72C5ABD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
83+
{5C3905CC-6B38-4C95-80FC-0DB5B72C5ABD}.Debug|Any CPU.Build.0 = Debug|Any CPU
84+
{5C3905CC-6B38-4C95-80FC-0DB5B72C5ABD}.Release|Any CPU.ActiveCfg = Release|Any CPU
85+
{5C3905CC-6B38-4C95-80FC-0DB5B72C5ABD}.Release|Any CPU.Build.0 = Release|Any CPU
8086
EndGlobalSection
8187
GlobalSection(SolutionProperties) = preSolution
8288
HideSolutionNode = FALSE

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "9.0.100",
3+
"version": "10.0.100",
44
"rollForward": "latestFeature"
55
}
66
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net10.0</TargetFramework>
4+
<Copyright>Copyright © Dave Glick 2014, Jon Smith 2014, Alexander Zaytsev 2014 - 2024</Copyright>
5+
<DefineConstants>$(DefineConstants);EF_CORE;EF_CORE3;EF_CORE5</DefineConstants>
6+
<RootNamespace>DelegateDecompiler.EntityFramework.Tests</RootNamespace>
7+
</PropertyGroup>
8+
9+
10+
<ItemGroup>
11+
<Compile Include="..\DelegateDecompiler.EntityFramework.Tests\**\*.cs" Exclude="..\DelegateDecompiler.EntityFramework.Tests\obj\**">
12+
<Link>%(Name)</Link>
13+
</Compile>
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<Compile Include="..\DelegateDecompiler.EntityFrameworkCore.Tests\**\*.cs" Exclude="..\DelegateDecompiler.EntityFrameworkCore.Tests\obj\**">
18+
<Link>%(Name)</Link>
19+
</Compile>
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<Compile Remove="..\DelegateDecompiler.EntityFramework.Tests\EntityTypeConfigurationExtensionsTests.cs" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.0" />
28+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="10.0.0" />
29+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
30+
<PackageReference Include="NUnit" Version="3.13.3" />
31+
<PackageReference Include="NUnit.Analyzers" Version="4.2.0" PrivateAssets="all" />
32+
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
33+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="10.0.0" />
34+
</ItemGroup>
35+
36+
<ItemGroup>
37+
<None Include="..\DelegateDecompiler.EntityFramework.Tests\App.config" Link="App.config" />
38+
</ItemGroup>
39+
40+
<ItemGroup>
41+
<ProjectReference Include="..\DelegateDecompiler.EntityFrameworkCore5\DelegateDecompiler.EntityFrameworkCore5.csproj" />
42+
<ProjectReference Include="..\DelegateDecompiler.Tests\DelegateDecompiler.Tests.csproj" />
43+
</ItemGroup>
44+
45+
</Project>
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
Detail of supported commands
2+
============
3+
## Documentation produced for DelegateDecompiler, version 0.34.3.0 on Wednesday, 05 March 2025 18:24
4+
5+
This file documents what linq commands **DelegateDecompiler** supports when
6+
working with [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/) (EF).
7+
EF has one of the best implementations for converting Linq `IQueryable<>` commands into database
8+
access commands, in EF's case T-SQL. Therefore it is a good candidate for using in our tests.
9+
10+
This documentation was produced by compaired direct EF Linq queries against the same query implemented
11+
as a DelegateDecompiler's `Computed` properties. This produces a Supported/Not Supported flag
12+
on each command type tested. Tests are groups and ordered to try and make finding things
13+
easier.
14+
15+
So, if you want to use DelegateDecompiler and are not sure whether the linq command
16+
you want to use will work then clone this project and write your own tests.
17+
(See [How to add a test](HowToAddMoreTests.md) documentation on how to do this).
18+
If there is a problem then please fork the repository and add your own tests.
19+
That will make it much easier to diagnose your issue.
20+
21+
*Note: The test suite has only recently been set up and has only a handful of tests at the moment.
22+
More will appear as we move forward.*
23+
24+
25+
### Group: Basic Features
26+
#### [Select](../TestGroup05BasicFeatures/Test01Select.cs):
27+
- Supported
28+
* Bool Equals Constant (line 38)
29+
* Bool Equals Static Variable (line 61)
30+
* Int Equals Constant (line 82)
31+
* Select Property Without Computed Attribute (line 103)
32+
* Select Method Without Computed Attribute (line 124)
33+
* Select Abstract Member Over Tph Hierarchy (line 145)
34+
* Select Abstract Member Over Tph Hierarchy After Restricting To Subtype (line 166)
35+
* Select Abstract Member Over Tph Hierarchy With Generic Classes After Restricting To Subtype (line 184)
36+
* Select Abstract Member With Condition On It Over Tph Hierarchy With Generic Classes After Restricting To Subtype (line 212)
37+
* Select Multiple Levels Of Abstract Members Over Tph Hierarchy (line 234)
38+
* Select Select Many (line 256)
39+
40+
#### [Select Async](../TestGroup05BasicFeatures/Test02SelectAsync.cs):
41+
- Supported
42+
* Async (line 43)
43+
* Bool Equals Constant Async (line 83)
44+
* Decompile Upfront Bool Equals Constant Async (line 104)
45+
* Bool Equals Static Variable To Array Async (line 127)
46+
* Int Equals Constant (line 148)
47+
48+
#### [Equals And Not Equals](../TestGroup05BasicFeatures/Test03EqualsAndNotEquals.cs):
49+
- Supported
50+
* Int Equals Constant (line 36)
51+
* Int Equals Static Variable (line 58)
52+
* Int Equals String Length (line 79)
53+
* Int Not Equals String Length (line 100)
54+
55+
#### [Nullable](../TestGroup05BasicFeatures/Test04Nullable.cs):
56+
- Supported
57+
* Property Is Null (line 39)
58+
* Bool Equals Static Variable (line 62)
59+
* Int Equals Constant (line 83)
60+
* Nullable Init (line 104)
61+
* Nullable Add (line 125)
62+
63+
#### [Where](../TestGroup05BasicFeatures/Test05Where.cs):
64+
- Supported
65+
* Where Bool Equals Constant (line 37)
66+
* Where Bool Equals Static Variable (line 60)
67+
* Where Int Equals Constant (line 81)
68+
* Where Filters On Abstract Members Over Tph Hierarchy (line 102)
69+
70+
#### [Single](../TestGroup05BasicFeatures/Test10Single.cs):
71+
- Supported
72+
* Single Int Equals Unique Value (line 42)
73+
74+
#### [Single Async](../TestGroup05BasicFeatures/Test11SingleAsync.cs):
75+
- Supported
76+
* Single Int Equals Unique Value Async (line 48)
77+
78+
79+
### Group: Order Take
80+
#### [Order By](../TestGroup10OrderTake/Test01OrderBy.cs):
81+
- Supported
82+
* Order By Children Count (line 37)
83+
* Order By Children Count Then By String Length (line 59)
84+
* Where Any Children Then Order By Children Count (line 81)
85+
86+
#### [Skip Take](../TestGroup10OrderTake/Test02SkipTake.cs):
87+
- Supported
88+
* Order By Children Count Then Take (line 37)
89+
* Order By Children Count Then Skip And Take (line 59)
90+
* Where Any Children Then Order By Then Skip Take (line 81)
91+
92+
93+
### Group: Quantifier Operators
94+
#### [Any](../TestGroup12QuantifierOperators/Test01Any.cs):
95+
- Supported
96+
* Any Children (line 36)
97+
* Any Children With Filter (line 57)
98+
99+
#### [All](../TestGroup12QuantifierOperators/Test02All.cs):
100+
- Supported
101+
* Singleton All Filter (line 36)
102+
* All Filter On Children Int (line 57)
103+
104+
#### [Contains](../TestGroup12QuantifierOperators/Test03Contains.cs):
105+
- Supported
106+
* String Contains Constant String With Filter (line 37)
107+
108+
109+
### Group: Aggregation
110+
#### [Count](../TestGroup15Aggregation/Test01Count.cs):
111+
- Supported
112+
* Count Children (line 37)
113+
* Count Children With Filter (line 59)
114+
* Count Children With Filter By Closure (line 81)
115+
* Count Children With Filter By External Closure (line 104)
116+
* Count Children With Filter By External Closure2 (line 128)
117+
* Singleton Count Children With Filter (line 150)
118+
119+
#### [Sum](../TestGroup15Aggregation/Test02Sum.cs):
120+
- Supported
121+
* Sum Count In Children Where Children Can Be None (line 61)
122+
123+
#### [Count Async](../TestGroup15Aggregation/Test03CountAsync.cs):
124+
- Supported
125+
* Count Children Async (line 44)
126+
* Count Children With Filter Async (line 66)
127+
* Count Children With Filter By Closure Async (line 88)
128+
* Count Children With Filter By External Closure Async (line 111)
129+
* Count Children With Filter By External Closure2 Async (line 135)
130+
* Singleton Count Children With Filter Async (line 157)
131+
132+
133+
### Group: Types
134+
#### [Strings](../TestGroup50Types/Test01Strings.cs):
135+
- Supported
136+
* Concatenate Person Not Handle Null (line 36)
137+
* Concatenate Person Handle Null (line 57)
138+
* Concatenate Person Handle Name Order (line 80)
139+
* Select Generic Method Person Handle (line 101)
140+
* Filter Generic Method Person Handle (line 119)
141+
142+
#### [DateTime](../TestGroup50Types/Test05DateTime.cs):
143+
- Supported
144+
* DateTime Where Compare With Static Variable (line 39)
145+
146+
147+
### Group: Additional Features
148+
#### [Nested Expressions](../TestGroup90AdditionalFeatures/Test01NestedExpressions.cs):
149+
- Supported
150+
* Subquery As Context Extension Method (line 72)
151+
152+
153+
154+
The End

0 commit comments

Comments
 (0)