Skip to content

Commit 705ed68

Browse files
Prepare for NServiceBus 10 (#293)
* Update workflow files * Update global.json * Migrate to slnx * Remove unneeded solution dependencies * Change target framework to net10.0 * Remove redundant packages * Set LangVersion to preview to get 14.0 * Clean up 9.x projects to match standard pattern * Add NServiceBus 10 project * Run SystemJsonSerializer tests * Improve argument handling * Fix assertion --------- Co-authored-by: Brandon Ording <bording@gmail.com>
1 parent 579b2d8 commit 705ed68

34 files changed

+162
-401
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
- name: Setup .NET SDK
3131
uses: actions/setup-dotnet@v4.3.1
3232
with:
33-
dotnet-version: 8.0.x
33+
global-json-file: global.json
3434
- name: Build
3535
run: dotnet build src --configuration Release
3636
- name: Run tests
37-
uses: Particular/run-tests-action@v1.7.0
37+
uses: Particular/run-tests-action@v1.7.0

global.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"sdk": {
3-
"version": "8.0.400",
3+
"version": "10.0.0",
4+
"allowPrerelease": true,
45
"rollForward": "latestFeature"
56
}
67
}

src/Common/Common.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net472;net8.0</TargetFrameworks>
4+
<TargetFrameworks>net472;net10.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

src/Common/Program.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ static void Main(string[] args)
2626
var serializers = new[]
2727
{
2828
Type.GetType("JsonSerializerFacade", true),
29+
#if SYSTEMJSON
30+
Type.GetType("SystemJsonSerializerFacade", true),
31+
#endif
2932
Type.GetType("XmlSerializerFacade", true)
3033
};
3134
var testCases = DiscoverTestCases();
3235

33-
if (args.Contains("Serialize") || args.Length == 0)
36+
if (args.Contains("serialize", StringComparer.OrdinalIgnoreCase) || args.Length == 0)
3437
{
3538
Console.WriteLine("Running Serialization tests for:");
3639
Assert.Multiple(() =>
@@ -50,7 +53,7 @@ static void Main(string[] args)
5053
});
5154
}
5255

53-
if (args.Contains("Deserialize") || args.Length == 0)
56+
if (args.Contains("deserialize", StringComparer.OrdinalIgnoreCase) || args.Length == 0)
5457
{
5558
Console.WriteLine("Running Deserialization tests for:");
5659
Assert.Multiple(() =>
@@ -83,8 +86,7 @@ static void DeserializeAndVerify(ISerializerFacade serializer, TestCase testCase
8386
var files = Directory.GetFiles(testCaseFolder);
8487
if (files.Length == 0)
8588
{
86-
throw new Exception(
87-
"No available files to deserialize. Make sure to run the serialization test case first.");
89+
throw new Exception("No available files to deserialize. Make sure to run the serialization test case first.");
8890
}
8991

9092
foreach (var filePath in files)

src/Common/Tests/TestCases/TestPolymorphicCollections.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public override object CreateInstance() =>
3131

3232
public override void CheckIfAreEqual(object expectedObj, object actualObj)
3333
{
34-
var expected = (Polymorphic)actualObj;
35-
var actual = (Polymorphic)expectedObj;
34+
var expected = (Polymorphic)expectedObj;
35+
var actual = (Polymorphic)actualObj;
3636

37-
Assert.That(actual.Items, Is.EqualTo(expected.Items).AsCollection, "Polymorphic object graph does not match.");
37+
Assert.That(actual.Items, Is.EqualTo(expected.Items), "Polymorphic object graph does not match.");
3838
}
3939
}
4040
}

src/Custom.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<LangVersion>12.0</LangVersion>
4+
<LangVersion>preview</LangVersion>
55
</PropertyGroup>
66

77
</Project>

src/NServiceBus.Serializers.CompatTests.sln

Lines changed: 0 additions & 241 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<Solution>
2+
<Folder Name="/Solution Items/">
3+
<File Path="Custom.Build.props" />
4+
</Folder>
5+
<Project Path="Common/Common.csproj" />
6+
<Project Path="NServiceBus10.0/NServiceBus10.0.csproj" />
7+
<Project Path="NServiceBus3.3/NServiceBus3.3.csproj" />
8+
<Project Path="NServiceBus4.0/NServiceBus4.0.csproj" />
9+
<Project Path="NServiceBus4.1/NServiceBus4.1.csproj" />
10+
<Project Path="NServiceBus4.2/NServiceBus4.2.csproj" />
11+
<Project Path="NServiceBus4.3/NServiceBus4.3.csproj" />
12+
<Project Path="NServiceBus4.4/NServiceBus4.4.csproj" />
13+
<Project Path="NServiceBus4.5/NServiceBus4.5.csproj" />
14+
<Project Path="NServiceBus4.6/NServiceBus4.6.csproj" />
15+
<Project Path="NServiceBus4.7/NServiceBus4.7.csproj" />
16+
<Project Path="NServiceBus5.0/NServiceBus5.0.csproj" />
17+
<Project Path="NServiceBus5.1/NServiceBus5.1.csproj" />
18+
<Project Path="NServiceBus5.2/NServiceBus5.2.csproj" />
19+
<Project Path="NServiceBus6.0/NServiceBus6.0.csproj" />
20+
<Project Path="NServiceBus6.1/NServiceBus6.1.csproj" />
21+
<Project Path="NServiceBus6.2/NServiceBus6.2.csproj" />
22+
<Project Path="NServiceBus6.3/NServiceBus6.3.csproj" />
23+
<Project Path="NServiceBus6.4/NServiceBus6.4.csproj" />
24+
<Project Path="NServiceBus6.5/NServiceBus6.5.csproj" />
25+
<Project Path="NServiceBus7.0/NServiceBus7.0.csproj" />
26+
<Project Path="NServiceBus7.1/NServiceBus7.1.csproj" />
27+
<Project Path="NServiceBus7.2/NServiceBus7.2.csproj" />
28+
<Project Path="NServiceBus7.3/NServiceBus7.3.csproj" />
29+
<Project Path="NServiceBus7.4/NServiceBus7.4.csproj" />
30+
<Project Path="NServiceBus7.5/NServiceBus7.5.csproj" />
31+
<Project Path="NServiceBus7.6/NServiceBus7.6.csproj" />
32+
<Project Path="NServiceBus7.7/NServiceBus7.7.csproj" />
33+
<Project Path="NServiceBus7.8/NServiceBus7.8.csproj" />
34+
<Project Path="NServiceBus8.0/NServiceBus8.0.csproj" />
35+
<Project Path="NServiceBus8.1/NServiceBus8.1.csproj" />
36+
<Project Path="NServiceBus8.2/NServiceBus8.2.csproj" />
37+
<Project Path="NServiceBus9.0/NServiceBus9.0.csproj" />
38+
<Project Path="NServiceBus9.1/NServiceBus9.1.csproj" />
39+
<Project Path="NServiceBus9.2/NServiceBus9.2.csproj" />
40+
<Project Path="Tests/Tests.csproj" />
41+
</Solution>
File renamed without changes.

0 commit comments

Comments
 (0)