From 19d40a9c37c9d3ddb63d6a3ddc90aa5fd769914f Mon Sep 17 00:00:00 2001 From: Ruairidh MacLeod Date: Thu, 3 Oct 2024 21:43:02 +0100 Subject: [PATCH] Main entrypoints too tricky to test for now --- .../DicomDirectoryProcessor/DicomDirectoryProcessor.cs | 2 ++ src/SmiServices/Applications/DicomLoader/DicomLoader.cs | 3 +++ .../Applications/DynamicRulesTester/DynamicRulesTester.cs | 1 + src/SmiServices/Applications/ExtractImages/ExtractImages.cs | 2 +- src/SmiServices/Applications/TriggerUpdates/TriggerUpdates.cs | 2 ++ .../Microservices/CohortExtractor/CohortExtractor.cs | 2 ++ src/SmiServices/Microservices/CohortPackager/CohortPackager.cs | 2 ++ .../Microservices/DicomAnonymiser/DicomAnonymiser.cs | 2 ++ .../DicomRelationalMapper/DicomRelationalMapper.cs | 2 ++ .../Microservices/DicomReprocessor/DicomReprocessor.cs | 2 ++ src/SmiServices/Microservices/DicomTagReader/DicomTagReader.cs | 2 ++ src/SmiServices/Microservices/FileCopier/FileCopier.cs | 2 ++ .../Microservices/IdentifierMapper/IdentifierMapper.cs | 2 ++ src/SmiServices/Microservices/IsIdentifiable/IsIdentifiable.cs | 2 ++ .../Microservices/MongoDBPopulator/MongoDBPopulator.cs | 2 ++ src/SmiServices/Microservices/UpdateValues/UpdateValues.cs | 2 ++ 16 files changed, 31 insertions(+), 1 deletion(-) diff --git a/src/SmiServices/Applications/DicomDirectoryProcessor/DicomDirectoryProcessor.cs b/src/SmiServices/Applications/DicomDirectoryProcessor/DicomDirectoryProcessor.cs index b30895982..90e6e8464 100644 --- a/src/SmiServices/Applications/DicomDirectoryProcessor/DicomDirectoryProcessor.cs +++ b/src/SmiServices/Applications/DicomDirectoryProcessor/DicomDirectoryProcessor.cs @@ -1,6 +1,7 @@ using SmiServices.Common.Execution; using SmiServices.Common.Options; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Applications.DicomDirectoryProcessor { @@ -18,6 +19,7 @@ public static class DicomDirectoryProcessor /// Arguments. There should be exactly one argument that specified the /// path to the top level directory that is be searched. /// + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit diff --git a/src/SmiServices/Applications/DicomLoader/DicomLoader.cs b/src/SmiServices/Applications/DicomLoader/DicomLoader.cs index d4cc5dc71..70a569da4 100644 --- a/src/SmiServices/Applications/DicomLoader/DicomLoader.cs +++ b/src/SmiServices/Applications/DicomLoader/DicomLoader.cs @@ -20,12 +20,15 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Applications.DicomLoader; public static class DicomLoader { private static CancellationTokenSource? _cts; + + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { return SmiCliInit.ParseAndRun(args, nameof(DicomLoader), OnParse); diff --git a/src/SmiServices/Applications/DynamicRulesTester/DynamicRulesTester.cs b/src/SmiServices/Applications/DynamicRulesTester/DynamicRulesTester.cs index c48f5eb8d..6034625a8 100644 --- a/src/SmiServices/Applications/DynamicRulesTester/DynamicRulesTester.cs +++ b/src/SmiServices/Applications/DynamicRulesTester/DynamicRulesTester.cs @@ -16,6 +16,7 @@ public static class DynamicRulesTester private static readonly ILogger _logger = LogManager.GetCurrentClassLogger(); private static IFileSystem _fileSystem = null!; + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args, IFileSystem? fileSystem = null) { _fileSystem = fileSystem ?? new FileSystem(); diff --git a/src/SmiServices/Applications/ExtractImages/ExtractImages.cs b/src/SmiServices/Applications/ExtractImages/ExtractImages.cs index 4e24dc9cf..f19fbf9bb 100644 --- a/src/SmiServices/Applications/ExtractImages/ExtractImages.cs +++ b/src/SmiServices/Applications/ExtractImages/ExtractImages.cs @@ -6,9 +6,9 @@ namespace SmiServices.Applications.ExtractImages { - [ExcludeFromCodeCoverage] public static class ExtractImages { + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit diff --git a/src/SmiServices/Applications/TriggerUpdates/TriggerUpdates.cs b/src/SmiServices/Applications/TriggerUpdates/TriggerUpdates.cs index 90fac3418..acd187d16 100644 --- a/src/SmiServices/Applications/TriggerUpdates/TriggerUpdates.cs +++ b/src/SmiServices/Applications/TriggerUpdates/TriggerUpdates.cs @@ -2,12 +2,14 @@ using SmiServices.Common.Options; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Applications.TriggerUpdates { public static class TriggerUpdates { + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit diff --git a/src/SmiServices/Microservices/CohortExtractor/CohortExtractor.cs b/src/SmiServices/Microservices/CohortExtractor/CohortExtractor.cs index 1b27f60fb..75cb099f3 100644 --- a/src/SmiServices/Microservices/CohortExtractor/CohortExtractor.cs +++ b/src/SmiServices/Microservices/CohortExtractor/CohortExtractor.cs @@ -1,11 +1,13 @@ using SmiServices.Common.Execution; using SmiServices.Common.Options; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Microservices.CohortExtractor { public static class CohortExtractor { + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit.ParseAndRun(args, nameof(CohortExtractor), OnParse); diff --git a/src/SmiServices/Microservices/CohortPackager/CohortPackager.cs b/src/SmiServices/Microservices/CohortPackager/CohortPackager.cs index 0413bf686..8ebeedbe6 100644 --- a/src/SmiServices/Microservices/CohortPackager/CohortPackager.cs +++ b/src/SmiServices/Microservices/CohortPackager/CohortPackager.cs @@ -9,12 +9,14 @@ using System.Collections.Generic; using System.IO; using System.IO.Abstractions; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Microservices.CohortPackager { public static class CohortPackager { + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit.ParseAndRun(args, nameof(CohortPackager), OnParse); diff --git a/src/SmiServices/Microservices/DicomAnonymiser/DicomAnonymiser.cs b/src/SmiServices/Microservices/DicomAnonymiser/DicomAnonymiser.cs index bfd938f8b..09c31b0a3 100644 --- a/src/SmiServices/Microservices/DicomAnonymiser/DicomAnonymiser.cs +++ b/src/SmiServices/Microservices/DicomAnonymiser/DicomAnonymiser.cs @@ -1,6 +1,7 @@ using SmiServices.Common.Execution; using SmiServices.Common.Options; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Microservices.DicomAnonymiser { @@ -10,6 +11,7 @@ public static class DicomAnonymiser /// Program entry point when run from the command line /// /// + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit.ParseAndRun(args, nameof(DicomAnonymiser), OnParse); diff --git a/src/SmiServices/Microservices/DicomRelationalMapper/DicomRelationalMapper.cs b/src/SmiServices/Microservices/DicomRelationalMapper/DicomRelationalMapper.cs index c33026265..cdd9ae1df 100644 --- a/src/SmiServices/Microservices/DicomRelationalMapper/DicomRelationalMapper.cs +++ b/src/SmiServices/Microservices/DicomRelationalMapper/DicomRelationalMapper.cs @@ -1,11 +1,13 @@ using SmiServices.Common.Execution; using SmiServices.Common.Options; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Microservices.DicomRelationalMapper { public static class DicomRelationalMapper { + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit.ParseAndRun(args, nameof(DicomRelationalMapper), OnParse); diff --git a/src/SmiServices/Microservices/DicomReprocessor/DicomReprocessor.cs b/src/SmiServices/Microservices/DicomReprocessor/DicomReprocessor.cs index 847d84db8..11f15015c 100644 --- a/src/SmiServices/Microservices/DicomReprocessor/DicomReprocessor.cs +++ b/src/SmiServices/Microservices/DicomReprocessor/DicomReprocessor.cs @@ -1,11 +1,13 @@ using SmiServices.Common.Execution; using SmiServices.Common.Options; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Microservices.DicomReprocessor { public static class DicomReprocessor { + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit.ParseAndRun(args, nameof(DicomReprocessor), OnParse); diff --git a/src/SmiServices/Microservices/DicomTagReader/DicomTagReader.cs b/src/SmiServices/Microservices/DicomTagReader/DicomTagReader.cs index 93a337b77..0114d5e71 100644 --- a/src/SmiServices/Microservices/DicomTagReader/DicomTagReader.cs +++ b/src/SmiServices/Microservices/DicomTagReader/DicomTagReader.cs @@ -4,6 +4,7 @@ using SmiServices.Microservices.DicomTagReader.Execution; using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Microservices.DicomTagReader { @@ -13,6 +14,7 @@ public static class DicomTagReader /// Program entry point when run from the command line /// /// + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit.ParseAndRun(args, nameof(DicomTagReader), OnParse); diff --git a/src/SmiServices/Microservices/FileCopier/FileCopier.cs b/src/SmiServices/Microservices/FileCopier/FileCopier.cs index 911613331..e1a365fd4 100644 --- a/src/SmiServices/Microservices/FileCopier/FileCopier.cs +++ b/src/SmiServices/Microservices/FileCopier/FileCopier.cs @@ -1,6 +1,7 @@ using SmiServices.Common.Execution; using SmiServices.Common.Options; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Microservices.FileCopier { @@ -10,6 +11,7 @@ public static class FileCopier /// Program entry point when run from the command line /// /// + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit.ParseAndRun(args, nameof(FileCopier), OnParse); diff --git a/src/SmiServices/Microservices/IdentifierMapper/IdentifierMapper.cs b/src/SmiServices/Microservices/IdentifierMapper/IdentifierMapper.cs index b5472f558..65113ada8 100644 --- a/src/SmiServices/Microservices/IdentifierMapper/IdentifierMapper.cs +++ b/src/SmiServices/Microservices/IdentifierMapper/IdentifierMapper.cs @@ -1,11 +1,13 @@ using SmiServices.Common.Execution; using SmiServices.Common.Options; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Microservices.IdentifierMapper { public static class IdentifierMapper { + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit.ParseAndRun(args, nameof(IdentifierMapper), OnParse); diff --git a/src/SmiServices/Microservices/IsIdentifiable/IsIdentifiable.cs b/src/SmiServices/Microservices/IsIdentifiable/IsIdentifiable.cs index 2c8ad5399..b4e4b6476 100644 --- a/src/SmiServices/Microservices/IsIdentifiable/IsIdentifiable.cs +++ b/src/SmiServices/Microservices/IsIdentifiable/IsIdentifiable.cs @@ -1,11 +1,13 @@ using SmiServices.Common.Execution; using SmiServices.Common.Options; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Microservices.IsIdentifiable { public static class IsIdentifiable { + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { diff --git a/src/SmiServices/Microservices/MongoDBPopulator/MongoDBPopulator.cs b/src/SmiServices/Microservices/MongoDBPopulator/MongoDBPopulator.cs index fad0aba15..803719c25 100644 --- a/src/SmiServices/Microservices/MongoDBPopulator/MongoDBPopulator.cs +++ b/src/SmiServices/Microservices/MongoDBPopulator/MongoDBPopulator.cs @@ -1,6 +1,7 @@ using SmiServices.Common.Execution; using SmiServices.Common.Options; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Microservices.MongoDBPopulator { @@ -9,6 +10,7 @@ public static class MongoDBPopulator /// /// Program entry point when run from command line /// + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { int ret = SmiCliInit.ParseAndRun(args, nameof(MongoDBPopulator), OnParse); diff --git a/src/SmiServices/Microservices/UpdateValues/UpdateValues.cs b/src/SmiServices/Microservices/UpdateValues/UpdateValues.cs index 54def77f0..1c1b6b6f9 100644 --- a/src/SmiServices/Microservices/UpdateValues/UpdateValues.cs +++ b/src/SmiServices/Microservices/UpdateValues/UpdateValues.cs @@ -1,12 +1,14 @@ using SmiServices.Common.Execution; using SmiServices.Common.Options; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace SmiServices.Microservices.UpdateValues { public static class UpdateValues { + [ExcludeFromCodeCoverage] public static int Main(IEnumerable args) { return SmiCliInit