Skip to content

Commit

Permalink
Use any cancellation token mockup instead of null one (#1603)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeaugrand authored Nov 25, 2022
1 parent cc2c239 commit edeaa57
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace AzureIoTHub.Portal.Tests.Unit.Client.Services
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Blazored.LocalStorage;
using FluentAssertions;
Expand Down Expand Up @@ -54,7 +55,7 @@ public void ToggleDrawerShouldUpdateTheValueOfIsDrawerOpenAndRaiseMajorUpdateOcc
public async Task ToggleDarkModeShouldUpdateTheValueOfIsDarkModeAndRaiseMajorUpdateOccurredEvent()
{
// Arrange
_ = this.mockLocalStorageService.Setup(x => x.SetItemAsync(LocalStorageKey.DarkTheme, true, null))
_ = this.mockLocalStorageService.Setup(x => x.SetItemAsync(LocalStorageKey.DarkTheme, true, It.IsAny<CancellationToken?>()))
.Returns(ValueTask.CompletedTask);

var receivedEvents = new List<string>();
Expand Down Expand Up @@ -155,7 +156,7 @@ public async Task SetNavGroupExpandedMustAddNewNavGroupKey()

var layoutService = new LayoutService(this.mockLocalStorageService.Object);

_ = this.mockLocalStorageService.Setup(x => x.SetItemAsync(LocalStorageKey.CollapsibleNavMenu, It.IsAny<Dictionary<string, bool>>(), null))
_ = this.mockLocalStorageService.Setup(x => x.SetItemAsync(LocalStorageKey.CollapsibleNavMenu, It.IsAny<Dictionary<string, bool>>(), It.IsAny<CancellationToken?>()))
.Returns(ValueTask.CompletedTask);

// Act
Expand All @@ -181,7 +182,7 @@ public async Task SetNavGroupExpandedMustUpdateExistingNavGroupKey()
}
};

_ = this.mockLocalStorageService.Setup(x => x.SetItemAsync(LocalStorageKey.CollapsibleNavMenu, It.IsAny<Dictionary<string, bool>>(), null))
_ = this.mockLocalStorageService.Setup(x => x.SetItemAsync(LocalStorageKey.CollapsibleNavMenu, It.IsAny<Dictionary<string, bool>>(), It.IsAny<CancellationToken?>()))
.Returns(ValueTask.CompletedTask);

// Act
Expand Down

0 comments on commit edeaa57

Please sign in to comment.