From 940baae655582519cce7a04e7901d44a633afdf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Wed, 5 Jul 2023 11:19:01 +0200 Subject: [PATCH] SEBWIN-679: Extended unit tests for core library. --- .../Operations/LazyInitializationOperationTests.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/SafeExamBrowser.Core.UnitTests/Operations/LazyInitializationOperationTests.cs b/SafeExamBrowser.Core.UnitTests/Operations/LazyInitializationOperationTests.cs index edef1681..208fb8ea 100644 --- a/SafeExamBrowser.Core.UnitTests/Operations/LazyInitializationOperationTests.cs +++ b/SafeExamBrowser.Core.UnitTests/Operations/LazyInitializationOperationTests.cs @@ -11,8 +11,8 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using SafeExamBrowser.Core.Contracts.OperationModel; using SafeExamBrowser.Core.Contracts.OperationModel.Events; -using SafeExamBrowser.I18n.Contracts; using SafeExamBrowser.Core.Operations; +using SafeExamBrowser.I18n.Contracts; namespace SafeExamBrowser.Core.UnitTests.Operations { @@ -147,5 +147,17 @@ namespace SafeExamBrowser.Core.UnitTests.Operations operationMock.Verify(o => o.Perform(), Times.Once); operationMock.Verify(o => o.Revert(), Times.Once); } + + [TestMethod] + public void MustNotFailOnEventRegistrationWithoutOperation() + { + var sut = new LazyInitializationOperation(() => default); + + sut.ActionRequired += default; + sut.StatusChanged += default; + + sut.ActionRequired -= default; + sut.StatusChanged -= default; + } } }