diff --git a/src/SLCore.Listeners.UnitTests/Implementation/Http/HttpConfigurationListenerTests.cs b/src/SLCore.Listeners.UnitTests/Implementation/Http/HttpConfigurationListenerTests.cs index 0f509ab9e..fcce74ee9 100644 --- a/src/SLCore.Listeners.UnitTests/Implementation/Http/HttpConfigurationListenerTests.cs +++ b/src/SLCore.Listeners.UnitTests/Implementation/Http/HttpConfigurationListenerTests.cs @@ -221,14 +221,24 @@ public async Task CheckServerTrustedAsync_CertificateIsValid_DoesNotShowNotifica private static string BuildUri(string scheme, string host) => $"{scheme}://{host}"; - private static bool IsExpectedNotification(INotification x) => - x.Id == HttpConfigurationListener.ServerCertificateInvalidNotificationId - && x.Message == SLCoreStrings.ServerCertificateInfobar_CertificateInvalidMessage - && HasExpectedActions(x); + private bool IsExpectedNotification(INotification x) + { + VerifyNotificationHasExpectedActions(x); + + return x.Id == HttpConfigurationListener.ServerCertificateInvalidNotificationId && x.Message == SLCoreStrings.ServerCertificateInfobar_CertificateInvalidMessage; + } - private static bool HasExpectedActions(INotification notification) => - notification.Actions.Count() == 2 - && notification.Actions.Any(x => x.CommandText == SLCoreStrings.ServerCertificateInfobar_LearnMore) - && notification.Actions.Any(x => x.CommandText == SLCoreStrings.ServerCertificateInfobar_ShowLogs); + private void VerifyNotificationHasExpectedActions(INotification notification) + { + notification.Actions.Should().HaveCount(2); + notification.Actions.Should().Contain(x => IsExpectedAction(x, SLCoreStrings.ServerCertificateInfobar_LearnMore)); + notification.Actions.Should().Contain(x => IsExpectedAction(x, SLCoreStrings.ServerCertificateInfobar_ShowLogs)); + + notification.Actions.First().Action.Invoke(null); + notification.Actions.Last().Action.Invoke(null); + browserService.Received(1).Navigate(DocumentationLinks.SslCertificate); + outputWindowService.Received(1).Show(); + } + private static bool IsExpectedAction(INotificationAction notificationAction, string expectedText) => notificationAction.CommandText == expectedText && !notificationAction.ShouldDismissAfterAction; }