diff --git a/SafeExamBrowser.Client.UnitTests/Operations/ClientHostDisconnectionOperationTests.cs b/SafeExamBrowser.Client.UnitTests/Operations/ClientHostDisconnectionOperationTests.cs index 4e4378fa..9d83e115 100644 --- a/SafeExamBrowser.Client.UnitTests/Operations/ClientHostDisconnectionOperationTests.cs +++ b/SafeExamBrowser.Client.UnitTests/Operations/ClientHostDisconnectionOperationTests.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using SafeExamBrowser.Client.Operations; +using SafeExamBrowser.Communication.Contracts.Events; using SafeExamBrowser.Communication.Contracts.Hosts; using SafeExamBrowser.Core.Contracts.OperationModel; using SafeExamBrowser.Logging.Contracts; @@ -57,6 +58,8 @@ namespace SafeExamBrowser.Client.UnitTests.Operations after = DateTime.Now; clientHost.VerifyGet(h => h.IsConnected); + clientHost.VerifyAdd(h => h.RuntimeDisconnected += It.IsAny()); + clientHost.VerifyRemove(h => h.RuntimeDisconnected -= It.IsAny()); clientHost.VerifyNoOtherCalls(); Assert.IsTrue(after - before < new TimeSpan(0, 0, 0, 0, timeout_ms)); @@ -78,6 +81,8 @@ namespace SafeExamBrowser.Client.UnitTests.Operations after = DateTime.Now; clientHost.VerifyGet(h => h.IsConnected); + clientHost.VerifyAdd(h => h.RuntimeDisconnected += It.IsAny()); + clientHost.VerifyRemove(h => h.RuntimeDisconnected -= It.IsAny()); clientHost.VerifyNoOtherCalls(); Assert.IsTrue(after - before >= new TimeSpan(0, 0, 0, 0, timeout_ms)); diff --git a/SafeExamBrowser.Runtime.UnitTests/RuntimeControllerTests.cs b/SafeExamBrowser.Runtime.UnitTests/RuntimeControllerTests.cs index d0b603f6..16ff57b7 100644 --- a/SafeExamBrowser.Runtime.UnitTests/RuntimeControllerTests.cs +++ b/SafeExamBrowser.Runtime.UnitTests/RuntimeControllerTests.cs @@ -309,6 +309,7 @@ namespace SafeExamBrowser.Runtime.UnitTests It.Is(a => a == MessageBoxAction.Confirm), It.Is(i => i == args.Icon), It.IsAny()), Times.Once); + clientProxy.VerifyAdd(p => p.ConnectionLost += It.IsAny()); clientProxy.VerifyNoOtherCalls(); }