Skip to content

Commit 7adf303

Browse files
committed
Remove nuget dependency and enable .net6
1 parent a65aa6d commit 7adf303

22 files changed

+72
-28
lines changed

LinkDotNet.Blog.IntegrationTests/Web/Pages/BlogPostPageTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
using System.Threading.Tasks;
2-
using Blazored.LocalStorage;
32
using Blazored.Toast.Services;
43
using Bunit;
54
using Bunit.TestDoubles;
65
using FluentAssertions;
76
using LinkDotNet.Blog.TestUtilities;
87
using LinkDotNet.Blog.Web.Pages;
98
using LinkDotNet.Blog.Web.Shared;
9+
using LinkDotNet.Blog.Web.Shared.Services;
1010
using LinkDotNet.Domain;
1111
using LinkDotNet.Infrastructure.Persistence;
1212
using Microsoft.EntityFrameworkCore;
@@ -47,8 +47,8 @@ public async Task ShouldSubtractLikeOnEvent()
4747
using var ctx = new TestContext();
4848
var localStorage = new Mock<ILocalStorageService>();
4949
var hasLikedStorage = $"hasLiked/{publishedPost.Id}";
50-
localStorage.Setup(l => l.ContainKeyAsync(hasLikedStorage, default)).ReturnsAsync(true);
51-
localStorage.Setup(l => l.GetItemAsync<bool>(hasLikedStorage, default)).ReturnsAsync(true);
50+
localStorage.Setup(l => l.ContainKeyAsync(hasLikedStorage)).ReturnsAsync(true);
51+
localStorage.Setup(l => l.GetItemAsync<bool>(hasLikedStorage)).ReturnsAsync(true);
5252
ctx.JSInterop.Mode = JSRuntimeMode.Loose;
5353
RegisterComponents(ctx, localStorage.Object);
5454
ctx.AddTestAuthorization().SetAuthorized("s");

LinkDotNet.Blog.IntegrationTests/Web/Pages/IndexTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using LinkDotNet.Blog.Web;
77
using LinkDotNet.Blog.Web.Pages;
88
using LinkDotNet.Blog.Web.Shared;
9+
using LinkDotNet.Blog.Web.Shared.Services;
910
using LinkDotNet.Domain;
1011
using LinkDotNet.Infrastructure.Persistence;
1112
using Microsoft.Extensions.DependencyInjection;

LinkDotNet.Blog.IntegrationTests/Web/Pages/SearchByTagTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
using FluentAssertions;
66
using LinkDotNet.Blog.TestUtilities;
77
using LinkDotNet.Blog.Web.Pages;
8-
using LinkDotNet.Blog.Web.Shared;
8+
using LinkDotNet.Blog.Web.Shared.Services;
99
using LinkDotNet.Domain;
1010
using LinkDotNet.Infrastructure.Persistence;
1111
using Microsoft.Extensions.DependencyInjection;

LinkDotNet.Blog.IntegrationTests/Web/Pages/SearchTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using LinkDotNet.Blog.TestUtilities;
66
using LinkDotNet.Blog.Web.Pages;
77
using LinkDotNet.Blog.Web.Shared;
8+
using LinkDotNet.Blog.Web.Shared.Services;
89
using LinkDotNet.Domain;
910
using LinkDotNet.Infrastructure.Persistence;
1011
using Microsoft.Extensions.DependencyInjection;

LinkDotNet.Blog.IntegrationTests/Web/Shared/ProfileTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using LinkDotNet.Blog.TestUtilities;
88
using LinkDotNet.Blog.Web;
99
using LinkDotNet.Blog.Web.Shared;
10+
using LinkDotNet.Blog.Web.Shared.Services;
1011
using LinkDotNet.Domain;
1112
using LinkDotNet.Infrastructure.Persistence;
1213
using Microsoft.Extensions.DependencyInjection;

LinkDotNet.Blog.IntegrationTests/Web/StartupTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using FluentAssertions;
22
using LinkDotNet.Blog.Web;
33
using LinkDotNet.Blog.Web.Pages.Admin;
4-
using LinkDotNet.Blog.Web.Shared;
4+
using LinkDotNet.Blog.Web.Shared.Services;
55
using LinkDotNet.Domain;
66
using LinkDotNet.Infrastructure.Persistence;
77
using Microsoft.AspNetCore;

LinkDotNet.Blog.UnitTests/Web/Shared/LikeTests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using Blazored.LocalStorage;
2-
using Bunit;
1+
using Bunit;
32
using FluentAssertions;
43
using LinkDotNet.Blog.TestUtilities;
54
using LinkDotNet.Blog.Web.Shared;
5+
using LinkDotNet.Blog.Web.Shared.Services;
66
using Microsoft.Extensions.DependencyInjection;
77
using Moq;
88
using Xunit;
@@ -60,15 +60,15 @@ public void ShouldSetLocalStorageVariableOnClick()
6060

6161
cut.Find("button").Click();
6262

63-
localStorage.Verify(l => l.SetItemAsync("hasLiked/id", true, default), Times.Once);
63+
localStorage.Verify(l => l.SetItemAsync("hasLiked/id", true), Times.Once);
6464
}
6565

6666
[Fact]
6767
public void ShouldCheckLocalStorageOnInit()
6868
{
6969
var localStorage = new Mock<ILocalStorageService>();
70-
localStorage.Setup(l => l.ContainKeyAsync("hasLiked/id", default)).ReturnsAsync(true);
71-
localStorage.Setup(l => l.GetItemAsync<bool>("hasLiked/id", default)).ReturnsAsync(true);
70+
localStorage.Setup(l => l.ContainKeyAsync("hasLiked/id")).ReturnsAsync(true);
71+
localStorage.Setup(l => l.GetItemAsync<bool>("hasLiked/id")).ReturnsAsync(true);
7272
Services.AddScoped(_ => localStorage.Object);
7373
var blogPost = new BlogPostBuilder().Build();
7474
blogPost.Id = "id";
@@ -93,8 +93,8 @@ public void ShouldCheckStorageOnClickAgainAndDoNothingOnMismatch()
9393
var cut = RenderComponent<Like>(
9494
p => p.Add(l => l.BlogPost, blogPost)
9595
.Add(l => l.OnBlogPostLiked, _ => wasClicked = true));
96-
localStorage.Setup(l => l.ContainKeyAsync("hasLiked/id", default)).ReturnsAsync(true);
97-
localStorage.Setup(l => l.GetItemAsync<bool>("hasLiked/id", default)).ReturnsAsync(true);
96+
localStorage.Setup(l => l.ContainKeyAsync("hasLiked/id")).ReturnsAsync(true);
97+
localStorage.Setup(l => l.GetItemAsync<bool>("hasLiked/id")).ReturnsAsync(true);
9898

9999
cut.Find("button").Click();
100100

LinkDotNet.Blog.UnitTests/Web/Shared/SortOrderCalculatorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using FluentAssertions;
22
using LinkDotNet.Blog.TestUtilities;
3-
using LinkDotNet.Blog.Web.Shared;
3+
using LinkDotNet.Blog.Web.Shared.Services;
44
using Xunit;
55

66
namespace LinkDotNet.Blog.UnitTests.Web.Shared

LinkDotNet.Blog.UnitTests/Web/Shared/UserRecordServiceTests.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using System;
22
using System.Threading.Tasks;
3-
using Blazored.LocalStorage;
43
using Bunit;
54
using Bunit.TestDoubles;
65
using FluentAssertions;
7-
using LinkDotNet.Blog.Web.Shared;
6+
using LinkDotNet.Blog.Web.Shared.Services;
87
using LinkDotNet.Domain;
98
using LinkDotNet.Infrastructure.Persistence;
109
using Moq;
@@ -55,9 +54,9 @@ public async Task ShouldGetUserHashAgain()
5554
{
5655
UserRecord recordToDb = null;
5756
var guidForUser = Guid.NewGuid();
58-
localStorageService.Setup(l => l.ContainKeyAsync("user", default))
57+
localStorageService.Setup(l => l.ContainKeyAsync("user"))
5958
.ReturnsAsync(true);
60-
localStorageService.Setup(l => l.GetItemAsync<Guid>("user", default))
59+
localStorageService.Setup(l => l.GetItemAsync<Guid>("user"))
6160
.ReturnsAsync(guidForUser);
6261
repositoryMock.Setup(r => r.StoreAsync(It.IsAny<UserRecord>()))
6362
.Callback<UserRecord>(u => recordToDb = u);
@@ -82,7 +81,7 @@ public async Task ShouldNotStoreForAdmin()
8281
[Fact]
8382
public async Task ShouldNotThrowExceptionToOutsideWorld()
8483
{
85-
localStorageService.Setup(l => l.ContainKeyAsync("user", default)).Throws<Exception>();
84+
localStorageService.Setup(l => l.ContainKeyAsync("user")).Throws<Exception>();
8685

8786
Func<Task> act = () => sut.StoreUserRecordAsync();
8887

LinkDotNet.Blog.Web/LinkDotNet.Blog.Web.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Blazored.LocalStorage" Version="4.1.5" />
109
<PackageReference Include="Blazored.Toast" Version="3.1.2" />
1110
<PackageReference Include="Markdig" Version="0.26.0" />
1211
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.9" />

0 commit comments

Comments
 (0)