From 12d0a043a34fe36a09b253455cfe4c45e748b812 Mon Sep 17 00:00:00 2001 From: Arthur van de Vondervoort Date: Sun, 24 Nov 2024 10:11:45 +0100 Subject: [PATCH] Add additional test for Obsolete on Rule0073 --- BusinessCentral.LinterCop.Test/Rule0073.cs | 2 ++ .../TestCases/Rule0073/NoDiagnostic/ObsoleteMethod.al | 8 ++++++++ .../TestCases/Rule0073/NoDiagnostic/ObsoleteObject.al | 9 +++++++++ 3 files changed, 19 insertions(+) create mode 100644 BusinessCentral.LinterCop.Test/TestCases/Rule0073/NoDiagnostic/ObsoleteMethod.al create mode 100644 BusinessCentral.LinterCop.Test/TestCases/Rule0073/NoDiagnostic/ObsoleteObject.al diff --git a/BusinessCentral.LinterCop.Test/Rule0073.cs b/BusinessCentral.LinterCop.Test/Rule0073.cs index aef6260..b5a6b7c 100644 --- a/BusinessCentral.LinterCop.Test/Rule0073.cs +++ b/BusinessCentral.LinterCop.Test/Rule0073.cs @@ -26,6 +26,8 @@ public async Task HasDiagnostic(string testCase) [Test] [TestCase("BusinessEvent")] [TestCase("IntegrationEvent")] + [TestCase("ObsoleteMethod")] + [TestCase("ObsoleteObject")] public async Task NoDiagnostic(string testCase) { var code = await File.ReadAllTextAsync(Path.Combine(_testCaseDir, "NoDiagnostic", $"{testCase}.al")) diff --git a/BusinessCentral.LinterCop.Test/TestCases/Rule0073/NoDiagnostic/ObsoleteMethod.al b/BusinessCentral.LinterCop.Test/TestCases/Rule0073/NoDiagnostic/ObsoleteMethod.al new file mode 100644 index 0000000..f8b09bf --- /dev/null +++ b/BusinessCentral.LinterCop.Test/TestCases/Rule0073/NoDiagnostic/ObsoleteMethod.al @@ -0,0 +1,8 @@ +codeunit 50100 MyCodeunit +{ + [IntegrationEvent(false, false)] + [Obsolete('Lorem ipsum dolor sit amet diam no', '1.0')] + local procedure OnBefore([|IsHandled|]: Boolean) + begin + end; +} \ No newline at end of file diff --git a/BusinessCentral.LinterCop.Test/TestCases/Rule0073/NoDiagnostic/ObsoleteObject.al b/BusinessCentral.LinterCop.Test/TestCases/Rule0073/NoDiagnostic/ObsoleteObject.al new file mode 100644 index 0000000..f359c56 --- /dev/null +++ b/BusinessCentral.LinterCop.Test/TestCases/Rule0073/NoDiagnostic/ObsoleteObject.al @@ -0,0 +1,9 @@ +codeunit 50100 MyCodeunit +{ + ObsoleteState = Pending; + + [IntegrationEvent(false, false)] + local procedure OnBefore([|IsHandled|]: Boolean) + begin + end; +} \ No newline at end of file