SEBWIN-679: Extended unit tests for core library.

This commit is contained in:
Damian Büchel 2023-07-05 11:19:01 +02:00
parent 8543c81867
commit 940baae655

View file

@ -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;
}
}
}