Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanfish committed Nov 9, 2022
1 parent 000cfc8 commit f900619
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions NAPS2.Lib.Tests/WinForms/DesktopControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class DesktopControllerTests : ContextualTests
private readonly Mock<IOperationFactory> _operationFactory;
private readonly StillImage _stillImage;
private readonly Mock<IUpdateChecker> _updateChecker;
private readonly Mock<INotificationManager> _notifcationManager;
private readonly Mock<INotificationManager> _notificationManager;
private readonly ImageTransfer _imageTransfer;
private readonly ImageClipboard _imageClipboard;
private readonly Mock<IExportController> _exportHelper;
Expand All @@ -49,7 +49,7 @@ public DesktopControllerTests()
_operationFactory = new Mock<IOperationFactory>();
_stillImage = new StillImage();
_updateChecker = new Mock<IUpdateChecker>();
_notifcationManager = new Mock<INotificationManager>();
_notificationManager = new Mock<INotificationManager>();
_imageTransfer = new ImageTransfer();
_imageClipboard = new ImageClipboard();
_exportHelper = new Mock<IExportController>();
Expand All @@ -69,11 +69,11 @@ public DesktopControllerTests()
_operationFactory.Object,
_stillImage,
_updateChecker.Object,
_notifcationManager.Object,
_notificationManager.Object,
_imageTransfer,
_imageClipboard,
new ImageListActions(_imageList, _operationFactory.Object, _operationProgress.Object,
_config, _thumbnailController),
_config, _thumbnailController, _exportHelper.Object, _notificationManager.Object),
_exportHelper.Object,
_dialogHelper.Object,
_desktopImagesController,
Expand Down Expand Up @@ -103,7 +103,7 @@ public async Task Initialize_IfNotRunBefore_SetsFirstRunDate()

Assert.True(_config.Get(c => c.HasBeenRun));
DateAsserts.Recent(TimeSpan.FromMilliseconds(100), _config.Get(c => c.FirstRunDate));
_notifcationManager.VerifyNoOtherCalls();
_notificationManager.VerifyNoOtherCalls();
}

[Fact]
Expand All @@ -117,7 +117,7 @@ public async Task Initialize_IfAlreadyRun_DoesntSetFirstRunDate()

Assert.True(_config.Get(c => c.HasBeenRun));
Assert.Equal(firstRunDate, _config.Get(c => c.FirstRunDate));
_notifcationManager.VerifyNoOtherCalls();
_notificationManager.VerifyNoOtherCalls();
}

[Fact]
Expand All @@ -129,7 +129,7 @@ public async Task Initialize_IfRun30DaysAgo_ShowsDonatePrompt()

await _desktopController.Initialize();

_notifcationManager.Verify(x => x.DonatePrompt());
_notificationManager.Verify(x => x.DonatePrompt());
Assert.True(_config.Get(c => c.HasBeenPromptedForDonation));
DateAsserts.Recent(TimeSpan.FromMilliseconds(100), _config.Get(c => c.LastDonatePromptDate));
}
Expand All @@ -148,7 +148,7 @@ public async Task Initialize_IfDonatePromptAlreadyShown_DoesntShowDonatePrompt()

Assert.True(_config.Get(c => c.HasBeenPromptedForDonation));
Assert.Equal(donatePromptDate, _config.Get(c => c.LastDonatePromptDate));
_notifcationManager.VerifyNoOtherCalls();
_notificationManager.VerifyNoOtherCalls();
}

[Fact]
Expand Down Expand Up @@ -185,7 +185,7 @@ public async Task Initialize_WithNoUpdate_DoesntPromptToUpdate()
DateAsserts.Recent(TimeSpan.FromMilliseconds(100), _config.Get(c => c.LastUpdateCheckDate));
_updateChecker.Verify(x => x.CheckForUpdates());
_updateChecker.VerifyNoOtherCalls();
_notifcationManager.VerifyNoOtherCalls();
_notificationManager.VerifyNoOtherCalls();
}

[Fact]
Expand All @@ -202,9 +202,9 @@ public async Task Initialize_WithUpdate_NotifiesOfUpdate()
Assert.True(_config.Get(c => c.HasCheckedForUpdates));
DateAsserts.Recent(TimeSpan.FromMilliseconds(100), _config.Get(c => c.LastUpdateCheckDate));
_updateChecker.Verify(x => x.CheckForUpdates());
_notifcationManager.Verify(x => x.UpdateAvailable(_updateChecker.Object, mockUpdateInfo));
_notificationManager.Verify(x => x.UpdateAvailable(_updateChecker.Object, mockUpdateInfo));
_updateChecker.VerifyNoOtherCalls();
_notifcationManager.VerifyNoOtherCalls();
_notificationManager.VerifyNoOtherCalls();
}

[Fact]
Expand All @@ -219,7 +219,7 @@ public async Task Initialize_WithNoUpdatePrompt_DoesntCheckForUpdate()
Assert.False(_config.Get(c => c.HasCheckedForUpdates));
Assert.Null(_config.Get(c => c.LastUpdateCheckDate));
_updateChecker.VerifyNoOtherCalls();
_notifcationManager.VerifyNoOtherCalls();
_notificationManager.VerifyNoOtherCalls();
}

[Fact]
Expand All @@ -236,7 +236,7 @@ public async Task Initialize_WithRecentUpdateCheck_DoesntCheckForUpdate()
Assert.True(_config.Get(c => c.HasCheckedForUpdates));
Assert.Equal(updateCheckDate, _config.Get(c => c.LastUpdateCheckDate));
_updateChecker.VerifyNoOtherCalls();
_notifcationManager.VerifyNoOtherCalls();
_notificationManager.VerifyNoOtherCalls();
}

[Fact]
Expand All @@ -256,8 +256,8 @@ public async Task Initialize_WithOldUpdateCheck_NotifiesOfUpdate()
Assert.True(_config.Get(c => c.HasCheckedForUpdates));
DateAsserts.Recent(TimeSpan.FromMilliseconds(100), _config.Get(c => c.LastUpdateCheckDate));
_updateChecker.Verify(x => x.CheckForUpdates());
_notifcationManager.Verify(x => x.UpdateAvailable(_updateChecker.Object, mockUpdateInfo));
_notificationManager.Verify(x => x.UpdateAvailable(_updateChecker.Object, mockUpdateInfo));
_updateChecker.VerifyNoOtherCalls();
_notifcationManager.VerifyNoOtherCalls();
_notificationManager.VerifyNoOtherCalls();
}
}

0 comments on commit f900619

Please sign in to comment.