From f0895ab73e1fe173c56c79bda3bfa15a131f34f4 Mon Sep 17 00:00:00 2001 From: Andreas Moth Date: Fri, 9 Feb 2024 16:06:47 +0100 Subject: [PATCH] Fix tests --- .../Test/NoSeries/src/ERMNoSeriesTests.Codeunit.al | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Business Foundation/Test/NoSeries/src/ERMNoSeriesTests.Codeunit.al b/src/Business Foundation/Test/NoSeries/src/ERMNoSeriesTests.Codeunit.al index 15a9a498dd..d5f174de2f 100644 --- a/src/Business Foundation/Test/NoSeries/src/ERMNoSeriesTests.Codeunit.al +++ b/src/Business Foundation/Test/NoSeries/src/ERMNoSeriesTests.Codeunit.al @@ -540,6 +540,7 @@ codeunit 134370 "ERM No. Series Tests" [Test] [TransactionModel(TransactionModel::AutoRollback)] + [HandlerFunctions('TestSeriesSuccessMessageHandler')] procedure NoSeriesThatCanGenerateNextNoSucceedsValidation() var NoSeriesLine: Record "No. Series Line"; @@ -557,6 +558,7 @@ codeunit 134370 "ERM No. Series Tests" [Test] [TransactionModel(TransactionModel::AutoRollback)] + [HandlerFunctions('TestSeriesSuccessMessageHandler')] procedure NoSeriesValidationDoesNotChangeTheNextNoGenerated() var NoSeriesLine: Record "No. Series Line"; @@ -1074,10 +1076,15 @@ codeunit 134370 "ERM No. Series Tests" NoSeriesPage.OK().Invoke(); end; - local procedure Initialize() begin PermissionsMock.Set('No. Series - Admin'); DeleteNumberSeries('TEST'); end; + + [MessageHandler] + procedure TestSeriesSuccessMessageHandler(Message: Text[1024]) + begin + LibraryAssert.IsTrue(Message.StartsWith('The test was successful.'), 'The test series was not successful, message: ' + Message); + end; }