diff --git a/SafeExamBrowser.Core.UnitTests/Behaviour/OperationModel/DelegateOperationTests.cs b/SafeExamBrowser.Core.UnitTests/Behaviour/OperationModel/DelegateOperationTests.cs index 817227b7..f89bb325 100644 --- a/SafeExamBrowser.Core.UnitTests/Behaviour/OperationModel/DelegateOperationTests.cs +++ b/SafeExamBrowser.Core.UnitTests/Behaviour/OperationModel/DelegateOperationTests.cs @@ -7,6 +7,7 @@ */ using Microsoft.VisualStudio.TestTools.UnitTesting; +using SafeExamBrowser.Contracts.Behaviour.OperationModel; using SafeExamBrowser.Core.Behaviour.OperationModel; namespace SafeExamBrowser.Core.UnitTests.Behaviour.OperationModel @@ -49,5 +50,19 @@ namespace SafeExamBrowser.Core.UnitTests.Behaviour.OperationModel Assert.IsTrue(reverted); } + + [TestMethod] + public void MustNotFailIfActionsAreNull() + { + var sut = new DelegateOperation(null, null, null); + + var perform = sut.Perform(); + var repeat = sut.Repeat(); + + sut.Revert(); + + Assert.AreEqual(OperationResult.Success, perform); + Assert.AreEqual(OperationResult.Success, repeat); + } } }