From 4087db909705f6624ba6013b7dd52ab4741af2a3 Mon Sep 17 00:00:00 2001 From: dbuechel Date: Wed, 19 Jun 2019 16:00:34 +0200 Subject: [PATCH] SEBWIN-301: Added missing test condition for session initalization operation. --- .../Operations/SessionInitializationOperationTests.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SafeExamBrowser.Service.UnitTests/Operations/SessionInitializationOperationTests.cs b/SafeExamBrowser.Service.UnitTests/Operations/SessionInitializationOperationTests.cs index 75364fbf..07ca7972 100644 --- a/SafeExamBrowser.Service.UnitTests/Operations/SessionInitializationOperationTests.cs +++ b/SafeExamBrowser.Service.UnitTests/Operations/SessionInitializationOperationTests.cs @@ -59,11 +59,17 @@ namespace SafeExamBrowser.Service.UnitTests.Operations } [TestMethod] - public void Perform_MustInitializeServiceEvent() + public void Perform_MustCloseOldAndInitializeNewServiceEvent() { + var stub = new EventStub(); + + sessionContext.ServiceEvent = stub; + var result = sut.Perform(); Assert.AreEqual(OperationResult.Success, result); + Assert.IsTrue(stub.IsClosed); + Assert.AreNotSame(stub, sessionContext.ServiceEvent); Assert.IsInstanceOfType(sessionContext.ServiceEvent, typeof(EventWaitHandle)); }