Skip to content

Commit

Permalink
Update MockBrowser to fix failing Unit Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brminnick committed Dec 22, 2021
1 parent 6fd97f9 commit 6aac815
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ namespace GitTrends.UnitTests
{
public class ExtendedNotificationService : NotificationService
{
public ExtendedNotificationService(IPreferences preferences,
public ExtendedNotificationService(IDeviceInfo deviceInfo,
IPreferences preferences,
ISecureStorage secureStorage,
IAnalyticsService analyticsService,
MobileSortingService sortingService,
DeepLinkingService deepLinkingService,
INotificationManager notificationManager,
AzureFunctionsApiService azureFunctionsApiService,
IDeviceNotificationsService deviceNotificationsService) :
base(preferences, secureStorage, analyticsService, sortingService, deepLinkingService, notificationManager, deviceNotificationsService, azureFunctionsApiService)
base(deviceInfo, preferences, secureStorage, analyticsService, sortingService, deepLinkingService, notificationManager, deviceNotificationsService, azureFunctionsApiService)
{

}
Expand Down
7 changes: 5 additions & 2 deletions GitTrends.UnitTests/MockServices/MockBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ public static event EventHandler<Uri> OpenAsyncExecuted

public Task OpenAsync(Uri uri, BrowserLaunchMode launchMode) => OpenAsync(uri, new BrowserLaunchOptions { LaunchMode = launchMode });

public Task<bool> OpenAsync(Uri uri, BrowserLaunchOptions options)
public async Task<bool> OpenAsync(Uri uri, BrowserLaunchOptions options)
{
await Task.Delay(TimeSpan.FromSeconds(1));

OnOpenAsyncExecuted(uri);
return Task.FromResult(true);

return true;
}

void OnOpenAsyncExecuted(in Uri uri) => _openAsyncExecutedEventHandler.RaiseEvent(this, uri, nameof(OpenAsyncExecuted));
Expand Down

0 comments on commit 6aac815

Please sign in to comment.