diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 124bb68..346ed58 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -33,10 +33,10 @@ jobs: run: dotnet build --no-restore - name: Install playwright dependencies shell: pwsh - run: ./test/Blog.Tests/bin/Debug/net9.0/playwright.ps1 install-deps + run: ./test/Blog.Tests/bin/Debug/net10.0/playwright.ps1 install-deps - name: Install playwright shell: pwsh - run: ./test/Blog.Tests/bin/Debug/net9.0/playwright.ps1 install + run: ./test/Blog.Tests/bin/Debug/net10.0/playwright.ps1 install - name: Test project run: dotnet test -e DOTNET_ENVIRONMENT=CI --no-build --verbosity normal -s ./test/Blog.Tests/ci.runsettings - name: Upload test results @@ -49,4 +49,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: playwright-traces - path: ./test/Blog.Tests/bin/Debug/net9.0/playwright-traces + path: ./test/Blog.Tests/bin/Debug/net10.0/playwright-traces diff --git a/.vscode/launch.json b/.vscode/launch.json index 6c8934d..0668f58 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -22,7 +22,7 @@ "type": "coreclr", "request": "launch", "preLaunchTask": "build_blog", - "program": "${workspaceFolder}/src/Blog/bin/Debug/net8.0/Blog.dll", + "program": "${workspaceFolder}/src/Blog/bin/Debug/net10.0/Blog.dll", "args": [], "cwd": "${workspaceFolder}/src/Blog", "stopAtEntry": false, diff --git a/.vscode/settings.json b/.vscode/settings.json index 90d34a2..83d04ac 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,7 @@ "Abramov", "Antiforgery", "blazor", + "Bunit", "Deets", "Entitize", "Hsts", diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index e5beb81..984754c 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,4 +1,3 @@ -version: '3.8' name: blog-development services: blog: diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 1ef0b21..010f741 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,4 +1,3 @@ -version: '3.8' name: blog-production services: blog: diff --git a/src/Blog/Blog.csproj b/src/Blog/Blog.csproj index 5fb9413..c4206a0 100644 --- a/src/Blog/Blog.csproj +++ b/src/Blog/Blog.csproj @@ -1,16 +1,16 @@ - net9.0 + net10.0 enable enable 16b1dba7-29d0-466e-bd34-16d8018898eb - - - + + + diff --git a/src/Blog/Components/App.razor b/src/Blog/Components/App.razor index 0964fdf..806fdca 100644 --- a/src/Blog/Components/App.razor +++ b/src/Blog/Components/App.razor @@ -31,18 +31,6 @@ referrerpolicy="no-referrer-when-downgrade" /> } - - + \ No newline at end of file diff --git a/src/Blog/Components/Layout/Header.razor b/src/Blog/Components/Layout/Header.razor index 1853873..48bc2b3 100644 --- a/src/Blog/Components/Layout/Header.razor +++ b/src/Blog/Components/Layout/Header.razor @@ -4,8 +4,8 @@

journal

-

using - +

using + .NET @Environment.Version.Major

@@ -18,4 +18,4 @@ Stevan Freeborn
- + \ No newline at end of file diff --git a/src/Blog/Dockerfile b/src/Blog/Dockerfile index 5ca056d..be8211b 100644 --- a/src/Blog/Dockerfile +++ b/src/Blog/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:9.0 AS setup-stage +FROM mcr.microsoft.com/dotnet/sdk:10.0 AS setup-stage WORKDIR /app COPY *.csproj ./ RUN dotnet restore @@ -13,7 +13,7 @@ CMD ["dotnet", "watch"] FROM setup-stage as build-stage RUN dotnet publish -c Release -o dist -FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS production-stage +FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS production-stage WORKDIR /app COPY --from=build-stage /app/dist ./ ENTRYPOINT ["dotnet", "Blog.dll"] diff --git a/test/Blog.Tests/Blog.Tests.csproj b/test/Blog.Tests/Blog.Tests.csproj index 1c37bed..8fe925d 100644 --- a/test/Blog.Tests/Blog.Tests.csproj +++ b/test/Blog.Tests/Blog.Tests.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 enable enable @@ -10,19 +10,19 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - + + + + - - - + + + diff --git a/test/Blog.Tests/EndToEnd/BlogTest.cs b/test/Blog.Tests/EndToEnd/BlogTest.cs index 13a1c42..6326d36 100644 --- a/test/Blog.Tests/EndToEnd/BlogTest.cs +++ b/test/Blog.Tests/EndToEnd/BlogTest.cs @@ -1,7 +1,7 @@ namespace Blog.Tests.EndToEnd; [TestFixture] -public class BlogTest : PageTest +public abstract class BlogTest : PageTest { private readonly BlogHostFactory _factory = new(); diff --git a/test/Blog.Tests/Unit/Feed.spec.razor b/test/Blog.Tests/Unit/Feed.spec.razor index 708f372..e4a4244 100644 --- a/test/Blog.Tests/Unit/Feed.spec.razor +++ b/test/Blog.Tests/Unit/Feed.spec.razor @@ -1,6 +1,6 @@ -@inherits Bunit.TestContext +@inherits Bunit.BunitContext -@code +@code { private Mock _postServiceMock = new(); @@ -8,10 +8,10 @@ public void Feed_WhenRendedAndNoPosts_ItShouldRenderNoPostsMessage() { _postServiceMock - .Setup(x => x.GetPostsAsync()) - .ReturnsAsync(new List()); + .Setup(x => x.GetPostsAsync()) + .ReturnsAsync(new List()); - var ctx = new TestContext(); + var ctx = new BunitContext(); ctx.Services.AddSingleton(_postServiceMock.Object); @@ -24,15 +24,15 @@ public void Feed_WhenRendedAndPosts_ItShouldRenderPosts() { List posts = [ - new Post() { Title = "Post 1", }, - new Post() { Title = "Post 2", }, - ]; + new Post() { Title = "Post 1", }, +new Post() { Title = "Post 2", }, +]; _postServiceMock - .Setup(x => x.GetPostsAsync()) - .ReturnsAsync(posts); + .Setup(x => x.GetPostsAsync()) + .ReturnsAsync(posts); - var ctx = new TestContext(); + var ctx = new BunitContext(); ctx.Services.AddScoped(_ => _postServiceMock.Object); diff --git a/test/Blog.Tests/Unit/Footer.spec.razor b/test/Blog.Tests/Unit/Footer.spec.razor index 80e5717..a774944 100644 --- a/test/Blog.Tests/Unit/Footer.spec.razor +++ b/test/Blog.Tests/Unit/Footer.spec.razor @@ -1,11 +1,11 @@ -@inherits Bunit.TestContext +@inherits Bunit.BunitContext -@code +@code { [Test] public void Footer_WhenRendered_ItShouldRenderFooterWithNavLinks() { - var ctx = new TestContext(); + var ctx = new BunitContext(); var cut = ctx.Render(@