From 33c47f5b4ad15bd6234251eea1ff4a4e792dec69 Mon Sep 17 00:00:00 2001 From: dbuechel Date: Fri, 15 Feb 2019 09:34:21 +0100 Subject: [PATCH] SEBWIN-296: Extended unit tests for base host. --- .../Hosts/BaseHostTests.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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); + } } }