Skip to content

Commit 83a66f7

Browse files
committed
Update to .NET 10 Preview 1
- and change the unit test framework from xUnit to NUnit
1 parent a1debb9 commit 83a66f7

File tree

10 files changed

+52
-52
lines changed

10 files changed

+52
-52
lines changed

.github/workflows/gh-pages.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ jobs:
1616
- name: Setup .NET SDK
1717
uses: actions/setup-dotnet@v4
1818
with:
19-
dotnet-version: "9.0.x"
19+
dotnet-version: "10.0.x"
20+
dotnet-quality: 'preview'
2021
- name: Install .NET WebAssembly Tools
2122
run: dotnet workload install wasm-tools
2223

CUIFlavoredPortfolioSite.Test/CUIFlavoredPortfolioSite.Test.csproj

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<ImplicitUsings>enable</ImplicitUsings>
7+
<EnableNUnitRunner>true</EnableNUnitRunner>
8+
<OutputType>Exe</OutputType>
9+
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
710
</PropertyGroup>
811

912
<ItemGroup>
10-
<PackageReference Include="ChainingAssertion-xUnit.Bin" Version="1.8.2" />
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
12-
<PackageReference Include="System.Net.Http" Version="4.3.4" />
13-
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
13+
<PackageReference Include="ChainingAssertion-NUnit.Bin" Version="4.0.1" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
1415
<PackageReference Include="Toolbelt.AnsiEscCode.Colorize" Version="1.0.0" />
15-
<PackageReference Include="xunit" Version="2.9.2" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
17-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
16+
<PackageReference Include="NUnit" Version="4.3.2" />
17+
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
18+
<PackageReference Include="NUnit.Analyzers" Version="4.6.0">
1819
<PrivateAssets>all</PrivateAssets>
20+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1921
</PackageReference>
20-
<PackageReference Include="coverlet.collector" Version="6.0.2">
22+
<PackageReference Include="coverlet.collector" Version="6.0.4">
2123
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2224
<PrivateAssets>all</PrivateAssets>
2325
</PackageReference>

CUIFlavoredPortfolioSite.Test/CommandCompletionTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using CUIFlavoredPortfolioSite.Services;
22
using CUIFlavoredPortfolioSite.Services.CommandSet;
33
using CUIFlavoredPortfolioSite.Services.ConsoleHost;
4-
using Xunit;
4+
using NUnit.Framework;
55

66
namespace CUIFlavoredPortfolioSite.Test;
77

@@ -22,15 +22,15 @@ private class TestCommand : ICommand
2222
new TestCommand("banner"),
2323
};
2424

25-
[Fact]
25+
[Test]
2626
public void Completion_NoMatch_Test()
2727
{
2828
var completion = new CommandCompletion(this._TestCommands);
2929
completion.Completion("foo").Is("foo");
3030
completion.Completion("foo").Is("foo");
3131
}
3232

33-
[Fact]
33+
[Test]
3434
public void Completion_FromEmpty_Test()
3535
{
3636
var completion = new CommandCompletion(this._TestCommands);
@@ -44,7 +44,7 @@ public void Completion_FromEmpty_Test()
4444
completion.Completion("banner").Is("clear");
4545
}
4646

47-
[Fact]
47+
[Test]
4848
public void Completion_FromEmpty_to_NoMatch_Test()
4949
{
5050
var completion = new CommandCompletion(this._TestCommands);
@@ -54,7 +54,7 @@ public void Completion_FromEmpty_to_NoMatch_Test()
5454
completion.Completion("bar").Is("bar");
5555
}
5656

57-
[Fact]
57+
[Test]
5858
public void Completion_FromEmpty_to_AnotherMatch_Test()
5959
{
6060
var completion = new CommandCompletion(this._TestCommands);
@@ -73,7 +73,7 @@ public void Completion_FromEmpty_to_AnotherMatch_Test()
7373
completion.Completion("banner").Is("clear");
7474
}
7575

76-
[Fact]
76+
[Test]
7777
public void Completion_Match_to_AnotherMatch_Test()
7878
{
7979
var completion = new CommandCompletion(this._TestCommands);

CUIFlavoredPortfolioSite.Test/CommandHistoryTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
using CUIFlavoredPortfolioSite.Services;
2-
using Xunit;
2+
using NUnit.Framework;
33

44
namespace CUIFlavoredPortfolioSite.Test;
55

66
public class CommandHistoryTest
77
{
8-
[Fact]
8+
[Test]
99
public void PrevNext_on_EmptyBuff_Test()
1010
{
1111
var commandHistory = new CommandHistory();
1212
commandHistory.TryGetNext(out var _).Is(false);
1313
commandHistory.TryGetPrevious(out var _).Is(false);
1414
}
1515

16-
[Fact]
16+
[Test]
1717
public void Push_EmptyCommand_Test()
1818
{
1919
var commandHistory = new CommandHistory();
@@ -26,7 +26,7 @@ public void Push_EmptyCommand_Test()
2626
commandHistory.TryGetNext(out var _).Is(false);
2727
}
2828

29-
[Fact]
29+
[Test]
3030
public void PushNextPrev_Combo_Test()
3131
{
3232
var commandHistory = new CommandHistory();
@@ -38,7 +38,7 @@ public void PushNextPrev_Combo_Test()
3838
c1.Is("foo -b");
3939
}
4040

41-
[Fact]
41+
[Test]
4242
public void Push_and_PrevNext_Test()
4343
{
4444
var commandHistory = new CommandHistory();
@@ -85,7 +85,7 @@ public void Push_and_PrevNext_Test()
8585
c12.Is("foo -b");
8686
}
8787

88-
[Fact]
88+
[Test]
8989
public void BufferOverflow_Test()
9090
{
9191
var commandHistory = new CommandHistory { HistoryBuffSize = 3 };

CUIFlavoredPortfolioSite.Test/ConsoleHostServiceTest.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
using CUIFlavoredPortfolioSite.Services.ConsoleHost;
22
using CUIFlavoredPortfolioSite.Test.Internals;
3-
using Xunit;
3+
using NUnit.Framework;
44
using static Toolbelt.AnsiEscCode.Colorize;
55

66
namespace CUIFlavoredPortfolioSite.Test;
77

88
public class ConsoleHostServiceTest
99
{
10-
[Fact]
10+
[Test]
1111
public void Write_Test()
1212
{
1313
var host = new ConsoleHostService();
@@ -28,7 +28,7 @@ public void Write_Test()
2828
"t:Buzz,f:#cccccc|t:FizzBuzz,f:#cccccc");
2929
}
3030

31-
[Fact]
31+
[Test]
3232
public void WriteLine_Test()
3333
{
3434
var host = new ConsoleHostService();
@@ -61,7 +61,7 @@ public void WriteLine_Test()
6161
"t:Ipsum,f:#cccccc");
6262
}
6363

64-
[Fact]
64+
[Test]
6565
public void Clear_Test()
6666
{
6767
var host = new ConsoleHostService();
@@ -75,7 +75,7 @@ public void Clear_Test()
7575
host.Lines.Dump().Is("t:Fizz");
7676
}
7777

78-
[Fact]
78+
[Test]
7979
public void CorlorizeToFragments_Test()
8080
{
8181
var host = new ConsoleHostService();
@@ -91,7 +91,7 @@ public void CorlorizeToFragments_Test()
9191
"t:Lorem ipsum dolor sit,f:#cccccc");
9292
}
9393

94-
[Fact]
94+
[Test]
9595
public void HyperLinkFragments_Test()
9696
{
9797
var host = new ConsoleHostService();

CUIFlavoredPortfolioSite.Test/PathUtilityTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using CUIFlavoredPortfolioSite.Services;
2-
using Xunit;
2+
using NUnit.Framework;
33

44
namespace CUIFlavoredPortfolioSite.Test;
55

66
public class PathUtilityTest
77
{
8-
[Fact]
8+
[Test]
99
public void ReplaceUserHomePath_Test()
1010
{
1111
// Given
@@ -24,13 +24,13 @@ public void ReplaceUserHomePath_Test()
2424
pathUtility.ReplaceUserHomePath("/home/web_user12").Is("/home/web_user12");
2525
}
2626

27-
[Fact]
27+
[Test]
2828
public void RevertUserHomePath_Test()
2929
{
3030
// Given
3131
Environment.SetEnvironmentVariable("HOME", "/home/web_user1");
3232
var pathUtility = new PathUtility();
33-
33+
3434
// When & Then ...
3535
pathUtility.RevertUserHomePath("/home/foo").Is("/home/foo");
3636
pathUtility.RevertUserHomePath("~").Is("/home/web_user1");

CUIFlavoredPortfolioSite/App.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@
3232
</a>
3333
</footer>
3434

35-
<PWAUpdater Align="PWAUpdater.Aligns.Buttom" />
35+
<PWAUpdater Align="PWAUpdater.Aligns.Bottom" />

CUIFlavoredPortfolioSite/CUIFlavoredPortfolioSite.csproj

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
5-
<Version>1.3.0.0</Version>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<Version>1.3.1</Version>
66
<Authors>J.Sakamoto</Authors>
77
<Product>CUI Flavored Portfolio Site - Powered by Blazor WebAssembly</Product>
88
<Copyright>Copyright (C) J.Sakamoto</Copyright>
@@ -24,23 +24,20 @@
2424
</ItemGroup>
2525

2626
<ItemGroup>
27-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
28-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.0" PrivateAssets="all" />
29-
<PackageReference Include="System.Net.Http" Version="4.3.4" />
30-
<PackageReference Include="System.Net.Http.Json" Version="9.0.0" />
27+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.0-preview.1.*" />
28+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="10.0.0-preview.1.*" PrivateAssets="all" />
3129
<PackageReference Include="Figgle" Version="0.5.1" />
3230
<PackageReference Include="CommandLineSwitchParser" Version="1.1.0" />
33-
<PackageReference Include="BlazorWasmPreRendering.Build" Version="5.0.0" />
31+
<PackageReference Include="BlazorWasmPreRendering.Build" Version="6.0.0-preview.1" />
3432
<PackageReference Include="PublishSPAforGitHubPages.Build" Version="3.0.0" />
3533
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="4.8.4">
3634
<PrivateAssets>all</PrivateAssets>
3735
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
3836
</PackageReference>
39-
<PackageReference Include="System.Private.Uri" Version="4.3.2" />
40-
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
4137
<PackageReference Include="Toolbelt.AnsiEscCode.Colorize" Version="1.0.0" />
42-
<PackageReference Include="Toolbelt.Blazor.HotKeys2" Version="5.1.0" />
43-
<PackageReference Include="Toolbelt.Blazor.PWA.Updater" Version="2.1.0.1" />
38+
<PackageReference Include="Toolbelt.Blazor.GetProperty.Script" Version="1.3.0" />
39+
<PackageReference Include="Toolbelt.Blazor.HotKeys2" Version="6.0.0" />
40+
<PackageReference Include="Toolbelt.Blazor.PWA.Updater" Version="3.0.1" />
4441
<PackageReference Include="Toolbelt.Web.CssClassInlineBuilder" Version="3.1.0.1" />
4542
</ItemGroup>
4643
</Project>

CUIFlavoredPortfolioSite/Properties/launchSettings.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
}
99
},
1010
"profiles": {
11-
"IIS Express": {
12-
"commandName": "IISExpress",
11+
"https": {
12+
"commandName": "Project",
13+
"dotnetRunMessages": true,
1314
"launchBrowser": true,
1415
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
15-
"hotReloadProfile": "blazorwasm",
16+
"applicationUrl": "http://localhost:57528/;https://localhost:57529/",
1617
"environmentVariables": {
1718
"ASPNETCORE_ENVIRONMENT": "Development"
1819
}
1920
},
20-
"cui_flavored_portfolio_site": {
21-
"commandName": "Project",
22-
"dotnetRunMessages": true,
21+
"IIS Express": {
22+
"commandName": "IISExpress",
2323
"launchBrowser": true,
2424
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
25-
"applicationUrl": "http://localhost:57528/;https://localhost:57529/",
25+
"hotReloadProfile": "blazorwasm",
2626
"environmentVariables": {
2727
"ASPNETCORE_ENVIRONMENT": "Development"
2828
}

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.0",
3+
"version": "10.0.0",
44
"rollForward": "latestMinor",
55
"allowPrerelease": true
66
}

0 commit comments

Comments
 (0)