diff --git a/SafeExamBrowser.Communication.UnitTests/Hosts/BaseHostTests.cs b/SafeExamBrowser.Communication.UnitTests/Hosts/BaseHostTests.cs index 8d5c3ee7..90eafcf5 100644 --- a/SafeExamBrowser.Communication.UnitTests/Hosts/BaseHostTests.cs +++ b/SafeExamBrowser.Communication.UnitTests/Hosts/BaseHostTests.cs @@ -272,5 +272,20 @@ namespace SafeExamBrowser.Communication.UnitTests.Hosts Assert.IsInstanceOfType(response, typeof(ConfigurationResponse)); Assert.AreSame(configurationResponse, response); } + + [TestMethod] + public void MustLogStatusChangesOfHost() + { + sut.Start(); + + hostObject.Raise(h => h.Closed += null, It.IsAny()); + hostObject.Raise(h => h.Closing += null, It.IsAny()); + hostObject.Raise(h => h.Faulted += null, It.IsAny()); + hostObject.Raise(h => h.Opened += null, It.IsAny()); + hostObject.Raise(h => h.Opening += null, It.IsAny()); + + logger.Verify(l => l.Debug(It.IsAny()), Times.AtLeast(4)); + logger.Verify(l => l.Error(It.IsAny()), Times.Once); + } } }