diff --git a/.nuget/packages.config b/.nuget/packages.config index 4aed222aba..8588e1c7c2 100644 --- a/.nuget/packages.config +++ b/.nuget/packages.config @@ -1,4 +1,5 @@  + diff --git a/Rdmp.Core.Tests/Curation/ImportTests/GatherAndShareTests.cs b/Rdmp.Core.Tests/Curation/ImportTests/GatherAndShareTests.cs index a8ec16f1cf..462acc3070 100644 --- a/Rdmp.Core.Tests/Curation/ImportTests/GatherAndShareTests.cs +++ b/Rdmp.Core.Tests/Curation/ImportTests/GatherAndShareTests.cs @@ -138,7 +138,7 @@ public void GatherAndShare_Plugin_Test() $"Imaginary1{PackPluginRunner.PluginPackageSuffix}")); File.WriteAllBytes(f1.FullName, new byte[] { 0x1, 0x2 }); - var plugin = new Plugin(CatalogueRepository, new FileInfo( + var plugin = new Rdmp.Core.Curation.Data.Plugin(CatalogueRepository, new FileInfo( $"Imaginary{PackPluginRunner.PluginPackageSuffix}"), new Version(1, 1, 1), new Version(1, 1, 1)); var lma1 = new LoadModuleAssembly(CatalogueRepository, f1, plugin); diff --git a/Rdmp.Core.Tests/Curation/ImportTests/PluginClassTests.cs b/Rdmp.Core.Tests/Curation/ImportTests/PluginClassTests.cs index 9985d97131..527031f132 100644 --- a/Rdmp.Core.Tests/Curation/ImportTests/PluginClassTests.cs +++ b/Rdmp.Core.Tests/Curation/ImportTests/PluginClassTests.cs @@ -72,7 +72,7 @@ public void TestPlugin_OrphanImport_Sharing() $"Blah3.{PackPluginRunner.PluginPackageSuffix}")); File.WriteAllBytes(fi3.FullName, new byte[] { 0x3, 0x4 }); - var p = new Plugin(Repository, fi, new Version(1, 1, 1), new Version(1, 1, 1, 1)); + var p = new Rdmp.Core.Curation.Data.Plugin(Repository, fi, new Version(1, 1, 1), new Version(1, 1, 1, 1)); var lma = new LoadModuleAssembly(Repository, fi2, p); var lma2 = new LoadModuleAssembly(Repository, fi3, p); @@ -116,7 +116,7 @@ public void TestPlugin_OrphanImport_Sharing() [TestCase("Rdmp.Dicom", "Rdmp.Dicom")] public void Test_Plugin_ShortName(string fullname, string expected) { - var p = WhenIHaveA(); + var p = WhenIHaveA(); p.Name = fullname; Assert.AreEqual(expected, p.GetShortName()); } diff --git a/Rdmp.Core.Tests/DataExport/Data/ExtractableCohortAuditLogBuilderTests.cs b/Rdmp.Core.Tests/DataExport/Data/ExtractableCohortAuditLogBuilderTests.cs index daa8f64c25..4800f32fe9 100644 --- a/Rdmp.Core.Tests/DataExport/Data/ExtractableCohortAuditLogBuilderTests.cs +++ b/Rdmp.Core.Tests/DataExport/Data/ExtractableCohortAuditLogBuilderTests.cs @@ -82,7 +82,7 @@ public void AuditLogReFetch_WhenAuditLogIsRubbish() [Test] public void AuditLogReFetch_WhenSourceIsDeleted() { - var builder = new ExtractableCohortAuditLogBuilder(); + _ = new ExtractableCohortAuditLogBuilder(); var ei = WhenIHaveA(); var desc = ExtractableCohortAuditLogBuilder.GetDescription(ei); diff --git a/Rdmp.Core.Tests/DataExport/DataAccess/SelectedColumnsTests.cs b/Rdmp.Core.Tests/DataExport/DataAccess/SelectedColumnsTests.cs index 2402e4628c..7f40068785 100644 --- a/Rdmp.Core.Tests/DataExport/DataAccess/SelectedColumnsTests.cs +++ b/Rdmp.Core.Tests/DataExport/DataAccess/SelectedColumnsTests.cs @@ -34,12 +34,8 @@ public void CreateAndAssociateColumns() try { _ = new SelectedDataSets(DataExportRepository, config, ds, null); - var cols = config.GetAllExtractableColumnsFor(ds); - Assert.AreEqual(1, cols.Length); - Assert.AreEqual(extractableColumn, cols.Single()); - cols = config.GetAllExtractableColumnsFor(ds); Assert.AreEqual(1, cols.Length); diff --git a/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Components/RemoveDuplicatesTests.cs b/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Components/RemoveDuplicatesTests.cs index 6ebbc6e522..1f6f295c5c 100644 --- a/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Components/RemoveDuplicatesTests.cs +++ b/Rdmp.Core.Tests/DataLoad/Engine/Integration/PipelineTests/Components/RemoveDuplicatesTests.cs @@ -108,5 +108,6 @@ public void TestNulls() Assert.AreEqual(5, remover.ProcessPipelineData(dt, ThrowImmediatelyDataLoadEventListener.Quiet, new GracefulCancellationToken()).Rows.Count); + dt.Dispose(); } } \ No newline at end of file diff --git a/Rdmp.Core.Tests/Rdmp.Core.Tests.csproj b/Rdmp.Core.Tests/Rdmp.Core.Tests.csproj index beccbbc46a..1b14ccfd43 100644 --- a/Rdmp.Core.Tests/Rdmp.Core.Tests.csproj +++ b/Rdmp.Core.Tests/Rdmp.Core.Tests.csproj @@ -69,7 +69,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Rdmp.Core.Tests/Reports/DocumentationReportDatabaseEntitiesTests.cs b/Rdmp.Core.Tests/Reports/DocumentationReportDatabaseEntitiesTests.cs index 713af15238..8769c1f6c7 100644 --- a/Rdmp.Core.Tests/Reports/DocumentationReportDatabaseEntitiesTests.cs +++ b/Rdmp.Core.Tests/Reports/DocumentationReportDatabaseEntitiesTests.cs @@ -36,5 +36,6 @@ public void Test_DocumentationReportDatabaseEntities_Normal() iconProvider.GetImage(Arg.Any(), Arg.Any()).Returns(img); reporter.GenerateReport(store, ThrowImmediatelyCheckNotifier.Quiet, iconProvider, false); + img.Dispose(); } } \ No newline at end of file diff --git a/Rdmp.Core/CohortCommitting/Pipeline/Sources/CohortIdentificationConfigurationSource.cs b/Rdmp.Core/CohortCommitting/Pipeline/Sources/CohortIdentificationConfigurationSource.cs index 5c590e3f5c..39902ee674 100644 --- a/Rdmp.Core/CohortCommitting/Pipeline/Sources/CohortIdentificationConfigurationSource.cs +++ b/Rdmp.Core/CohortCommitting/Pipeline/Sources/CohortIdentificationConfigurationSource.cs @@ -122,10 +122,12 @@ private DataTable GetDataTable(IDataLoadEventListener listener) throw new Exception( "CohortIdentificationCriteria execution resulted in an empty dataset (there were no cohorts matched by the query?)"); - var dt = execution.Identifiers; + DataTable dt = execution.Identifiers; + dt.BeginLoadData(); foreach (DataColumn column in dt.Columns) column.ReadOnly = false; + dt.EndLoadData(); return dt; } diff --git a/Rdmp.Core/CohortCommitting/Pipeline/Sources/PatientIdentifierColumnSource.cs b/Rdmp.Core/CohortCommitting/Pipeline/Sources/PatientIdentifierColumnSource.cs index d8a814d305..7c54426682 100644 --- a/Rdmp.Core/CohortCommitting/Pipeline/Sources/PatientIdentifierColumnSource.cs +++ b/Rdmp.Core/CohortCommitting/Pipeline/Sources/PatientIdentifierColumnSource.cs @@ -54,7 +54,7 @@ private DataTable GetDataTable(int timeout, int? topX) var colName = _extractionInformation.GetRuntimeName(); - var dt = new DataTable(); + DataTable dt = new DataTable(); dt.BeginLoadData(); dt.Columns.Add(colName); diff --git a/Rdmp.Core/CohortCreation/Execution/AggregationContainerTask.cs b/Rdmp.Core/CohortCreation/Execution/AggregationContainerTask.cs index 542e3da15b..36f541cbc2 100644 --- a/Rdmp.Core/CohortCreation/Execution/AggregationContainerTask.cs +++ b/Rdmp.Core/CohortCreation/Execution/AggregationContainerTask.cs @@ -87,7 +87,7 @@ returned by this operation they must be in all the sets under this (including th APPEAR in any of the sets that come after the FIRST. This means that you get everyone in the first set EXCEPT anyone appearing in any of the other sets that follow the FIRST.", _ => throw new ArgumentOutOfRangeException( - $"Did not know what tool tip to return for set operation {ToString()}") + $"Did not know what tool tip to return for set operation {((CohortAggregateContainer)Child).Operation.ToString()}") }; } } \ No newline at end of file diff --git a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandClearUserSettings.cs b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandClearUserSettings.cs index 8ede45434d..7b8879baee 100644 --- a/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandClearUserSettings.cs +++ b/Rdmp.Core/CommandExecution/AtomicCommands/ExecuteCommandClearUserSettings.cs @@ -21,4 +21,4 @@ public override void Execute() UserSettings.ClearUserSettings(); } -} \ No newline at end of file +} diff --git a/Rdmp.Core/CommandLine/DatabaseCreation/CataloguePipelinesAndReferencesCreation.cs b/Rdmp.Core/CommandLine/DatabaseCreation/CataloguePipelinesAndReferencesCreation.cs index ac27c55721..00b4478dc9 100644 --- a/Rdmp.Core/CommandLine/DatabaseCreation/CataloguePipelinesAndReferencesCreation.cs +++ b/Rdmp.Core/CommandLine/DatabaseCreation/CataloguePipelinesAndReferencesCreation.cs @@ -109,7 +109,6 @@ private void CreateServers(PlatformDatabaseCreationOptions options) Console.WriteLine("Successfully configured RAW server"); } - public void CreatePipelines(PlatformDatabaseCreationOptions options) { var bulkInsertCsvPipe = diff --git a/Rdmp.Core/CommandLine/DatabaseCreation/PlatformDatabaseCreationOptions.cs b/Rdmp.Core/CommandLine/DatabaseCreation/PlatformDatabaseCreationOptions.cs index 8ad0271b5a..ba9423f493 100644 --- a/Rdmp.Core/CommandLine/DatabaseCreation/PlatformDatabaseCreationOptions.cs +++ b/Rdmp.Core/CommandLine/DatabaseCreation/PlatformDatabaseCreationOptions.cs @@ -45,7 +45,6 @@ public class PlatformDatabaseCreationOptions [Option('l', "Create Logging Server", Default = true, HelpText = "Create the default logging server in the Catalogue database once created. Is superseeded by 'Skip Pipelines'")] public bool CreateLoggingServer { get; set; } - [Option('e', "ExampleDatasets", Default = false, HelpText = "Create example datasets, projects, extraction configurations and cohort queries")] public bool ExampleDatasets { get; set; } diff --git a/Rdmp.Core/Curation/ANOEngineering/ForwardEngineerANOCatalogueEngine.cs b/Rdmp.Core/Curation/ANOEngineering/ForwardEngineerANOCatalogueEngine.cs index e0038b76cd..20b663904f 100644 --- a/Rdmp.Core/Curation/ANOEngineering/ForwardEngineerANOCatalogueEngine.cs +++ b/Rdmp.Core/Curation/ANOEngineering/ForwardEngineerANOCatalogueEngine.cs @@ -361,7 +361,6 @@ private ColumnInfo GetNewColumnInfoForOld(ColumnInfo col, bool isOptional = fals var toReturn = FindNewColumnNamed(syntaxHelper, col, col.GetRuntimeName(), isOptional) ?? FindNewColumnNamed(syntaxHelper, col, $"ANO{col.GetRuntimeName()}", isOptional); - if (toReturn == null) return isOptional ? null diff --git a/Rdmp.Core/Curation/Data/Aggregation/AggregateConfiguration.cs b/Rdmp.Core/Curation/Data/Aggregation/AggregateConfiguration.cs index 6c227855d5..69202d7a57 100644 --- a/Rdmp.Core/Curation/Data/Aggregation/AggregateConfiguration.cs +++ b/Rdmp.Core/Curation/Data/Aggregation/AggregateConfiguration.cs @@ -39,7 +39,7 @@ namespace Rdmp.Core.Curation.Data.Aggregation; /// 3. 'Joinable PatientIndex Table' - Produce a patient identifier fact table for joining to other Cohort Aggregates during cohort building (See JoinableCohortAggregateConfiguration) /// The above labels are informal terms. Use IsCohortIdentificationAggregate and IsJoinablePatientIndexTable to determine what type a given /// AggregateConfiguration is. -/// +/// /// If your Aggregate is part of cohort identification (Identifier List or Patient Index Table) then its name will start with cic_X_ where X is the ID of the cohort identification /// configuration. Depending on the user interface though this might not appear (See ToString implementation). /// @@ -257,7 +257,7 @@ private static bool IsBasicallyZero(object v) => v == null || v == DBNull.Value /// When an AggregateConfiguration is used in a cohort identification capacity it can have one or more 'patient index tables' defined e.g. /// 'Give me all prescriptions for morphine' (Prescribing) 'within 6 months of patient being discharged from hospital' (SMR01). In this case /// a join is done against the secondary dataset. - /// + /// /// This property returns all such 'patient index table' AggregateConfigurations which are currently being used by this AggregateConfiguration /// for building its join. /// diff --git a/Rdmp.Core/Curation/Data/Catalogue.cs b/Rdmp.Core/Curation/Data/Catalogue.cs index 37c0b0e97b..89526c8d7c 100644 --- a/Rdmp.Core/Curation/Data/Catalogue.cs +++ b/Rdmp.Core/Curation/Data/Catalogue.cs @@ -519,10 +519,17 @@ public int? LoadMetadata_ID /// [NoMappingToDatabase] - public ExternalDatabaseServer LiveLoggingServer => - LiveLoggingServer_ID == null - ? null - : Repository.GetObjectByID((int)LiveLoggingServer_ID); + public ExternalDatabaseServer LiveLoggingServer { + get{ + if(LiveLoggingServer_ID != null){ + ExternalDatabaseServer[] dbs = Repository.GetAllObjectsWhere("id",(int)LiveLoggingServer_ID); + if(dbs.Length > 0){ + return dbs.First(); + } + } + return null; + } + } /// [NoMappingToDatabase] diff --git a/Rdmp.Core/Curation/Data/DataLoad/ProcessTask.cs b/Rdmp.Core/Curation/Data/DataLoad/ProcessTask.cs index 87371332b4..ddf64cbcb8 100644 --- a/Rdmp.Core/Curation/Data/DataLoad/ProcessTask.cs +++ b/Rdmp.Core/Curation/Data/DataLoad/ProcessTask.cs @@ -358,7 +358,6 @@ public IArgument[] CreateArgumentsForClassIfNotExists(Type t) => //convert the result back from generic to specific (us) .ToArray(); - /// public IArgument[] CreateArgumentsForClassIfNotExists() => CreateArgumentsForClassIfNotExists(typeof(T)); diff --git a/Rdmp.Core/DataExport/Data/DeployedExtractionFilterParameter.cs b/Rdmp.Core/DataExport/Data/DeployedExtractionFilterParameter.cs index 559db26cb9..146d06e25a 100644 --- a/Rdmp.Core/DataExport/Data/DeployedExtractionFilterParameter.cs +++ b/Rdmp.Core/DataExport/Data/DeployedExtractionFilterParameter.cs @@ -141,4 +141,4 @@ public DeployedExtractionFilterParameter ShallowClone(DeployedExtractionFilter i CopyShallowValuesTo(clone); return clone; } -} \ No newline at end of file +} diff --git a/Rdmp.Core/DataExport/DataExtraction/ExtractionTimeValidator.cs b/Rdmp.Core/DataExport/DataExtraction/ExtractionTimeValidator.cs index 33037d1481..df32d5d989 100644 --- a/Rdmp.Core/DataExport/DataExtraction/ExtractionTimeValidator.cs +++ b/Rdmp.Core/DataExport/DataExtraction/ExtractionTimeValidator.cs @@ -50,7 +50,7 @@ public void Validate(DataTable dt, string validationColumnToPopulateIfAny) { if (!_initialized) Initialize(dt); - + dt.BeginLoadData(); foreach (DataRow r in dt.Rows) { //additive validation results, Results is a class that wraps DictionaryOfFailure which is an array of columns and each element is another array of consequences (with a row count for each consequence) @@ -61,6 +61,7 @@ public void Validate(DataTable dt, string validationColumnToPopulateIfAny) if (validationColumnToPopulateIfAny != null) r[validationColumnToPopulateIfAny] = consequenceOnLastRowProcessed; } + dt.EndLoadData(); } private void Initialize(DataTable dt) diff --git a/Rdmp.Core/DataLoad/Engine/Pipeline/Components/Anonymisation/ColumnInfoToANOTableConverter.cs b/Rdmp.Core/DataLoad/Engine/Pipeline/Components/Anonymisation/ColumnInfoToANOTableConverter.cs index 2e55695586..d20ee9d2b6 100644 --- a/Rdmp.Core/DataLoad/Engine/Pipeline/Components/Anonymisation/ColumnInfoToANOTableConverter.cs +++ b/Rdmp.Core/DataLoad/Engine/Pipeline/Components/Anonymisation/ColumnInfoToANOTableConverter.cs @@ -152,7 +152,7 @@ private void MigrateExistingData(Func shouldApplySql, DbConnection throw new Exception("User decided not to perform update on table"); cmdUpdateMainTable.ExecuteNonQuery(); } - finally + finally { //always drop the temp anomap using var dropMappingTable = DatabaseCommandHelper.GetCommand("DROP TABLE TempANOMap", con); diff --git a/Rdmp.Core/DataLoad/Engine/Pipeline/Components/CleanStrings.cs b/Rdmp.Core/DataLoad/Engine/Pipeline/Components/CleanStrings.cs index 2f6e34f20d..df8cc88c38 100644 --- a/Rdmp.Core/DataLoad/Engine/Pipeline/Components/CleanStrings.cs +++ b/Rdmp.Core/DataLoad/Engine/Pipeline/Components/CleanStrings.cs @@ -31,7 +31,6 @@ public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener GracefulCancellationToken cancellationToken) { timer.Start(); - StartAgain: foreach (DataRow row in toProcess.Rows) { @@ -85,7 +84,6 @@ public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener job.OnProgress(this, new ProgressEventArgs(_taskDescription, new ProgressMeasurement(_rowsProcessed, ProgressType.Records), timer.Elapsed)); - return toProcess; } diff --git a/Rdmp.Core/DataLoad/Modules/Attachers/FixedWidthFormatFile.cs b/Rdmp.Core/DataLoad/Modules/Attachers/FixedWidthFormatFile.cs index 64f06178ea..34e3866b04 100644 --- a/Rdmp.Core/DataLoad/Modules/Attachers/FixedWidthFormatFile.cs +++ b/Rdmp.Core/DataLoad/Modules/Attachers/FixedWidthFormatFile.cs @@ -77,7 +77,7 @@ public FixedWidthFormatFile(FileInfo pathToFormatFile) public DataTable GetDataTableFromFlatFile(FileInfo f) { //setup the table - var toReturn = new DataTable(); + DataTable toReturn = new DataTable(); toReturn.BeginLoadData(); foreach (var fixedWidthColumn in FormatColumns) diff --git a/Rdmp.Core/DataLoad/Modules/DataFlowOperations/CohortSampler.cs b/Rdmp.Core/DataLoad/Modules/DataFlowOperations/CohortSampler.cs index 7f7b902e33..666b876a68 100644 --- a/Rdmp.Core/DataLoad/Modules/DataFlowOperations/CohortSampler.cs +++ b/Rdmp.Core/DataLoad/Modules/DataFlowOperations/CohortSampler.cs @@ -107,7 +107,7 @@ public DataTable ProcessPipelineData(DataTable toProcess, IDataLoadEventListener throw new Exception( $"Cohort only contains {chosen.Count} unique identifiers. This is less than the requested sample size of {SampleSize} and {nameof(FailIfNotEnoughIdentifiers)} is true"); - var dtToReturn = new DataTable(); + DataTable dtToReturn = new DataTable(); dtToReturn.BeginLoadData(); dtToReturn.Columns.Add(expectedFieldName); diff --git a/Rdmp.Core/DataLoad/Modules/DataFlowOperations/Transposer.cs b/Rdmp.Core/DataLoad/Modules/DataFlowOperations/Transposer.cs index 5beb1ac206..cf8dbbc549 100644 --- a/Rdmp.Core/DataLoad/Modules/DataFlowOperations/Transposer.cs +++ b/Rdmp.Core/DataLoad/Modules/DataFlowOperations/Transposer.cs @@ -65,7 +65,7 @@ public void Check(ICheckNotifier notifier) private DataTable GenerateTransposedTable(DataTable inputTable) { - var outputTable = new DataTable(); + DataTable outputTable = new DataTable(); outputTable.BeginLoadData(); // Add columns by looping rows diff --git a/Rdmp.Core/DataLoad/Modules/DataFlowSources/ExcelDataFlowSource.cs b/Rdmp.Core/DataLoad/Modules/DataFlowSources/ExcelDataFlowSource.cs index 34ff3248d1..8a9f0d9077 100644 --- a/Rdmp.Core/DataLoad/Modules/DataFlowSources/ExcelDataFlowSource.cs +++ b/Rdmp.Core/DataLoad/Modules/DataFlowSources/ExcelDataFlowSource.cs @@ -124,7 +124,6 @@ public DataTable GetAllData(ISheet worksheet, IDataLoadEventListener listener) { var toReturn = new DataTable(); toReturn.BeginLoadData(); - var rowEnumerator = worksheet.GetRowEnumerator(); var nColumns = -1; @@ -188,7 +187,6 @@ public DataTable GetAllData(ISheet worksheet, IDataLoadEventListener listener) if (!gotAtLeastOneGoodValue) toReturn.Rows.Remove(r); } - return toReturn; } diff --git a/Rdmp.Core/DataLoad/Modules/DataFlowSources/SubComponents/FlatFileToDataTablePusher.cs b/Rdmp.Core/DataLoad/Modules/DataFlowSources/SubComponents/FlatFileToDataTablePusher.cs index 57bd98471e..0788f9f908 100644 --- a/Rdmp.Core/DataLoad/Modules/DataFlowSources/SubComponents/FlatFileToDataTablePusher.cs +++ b/Rdmp.Core/DataLoad/Modules/DataFlowSources/SubComponents/FlatFileToDataTablePusher.cs @@ -306,7 +306,6 @@ public DataTable StronglyTypeTable(DataTable workingTable, ExplicitTypingCollect foreach (DataRow row in workingTable.Rows) dtCloned.Rows.Add(row.ItemArray.Select((v, idx) => deciders.TryGetValue(idx, out var decider) && v is string s ? decider.Parse(s) : v).ToArray()); - return dtCloned; } diff --git a/Rdmp.Core/DataLoad/Modules/FileOperations/FileUnzipper.cs b/Rdmp.Core/DataLoad/Modules/FileOperations/FileUnzipper.cs index 9e1439a9e0..980daf8d85 100644 --- a/Rdmp.Core/DataLoad/Modules/FileOperations/FileUnzipper.cs +++ b/Rdmp.Core/DataLoad/Modules/FileOperations/FileUnzipper.cs @@ -46,8 +46,7 @@ public void Initialize(ILoadDirectory directory, DiscoveredDatabase dbInfo) public ExitCodeType Fetch(IDataLoadJob job, GracefulCancellationToken cancellationToken) { - foreach (var fileInfo in job.LoadDirectory.ForLoading.GetFiles("*.zip")) - { + foreach (var fileInfo in job.LoadDirectory.ForLoading.GetFiles("*.zip")){ //do it as regex rather than in GetFiles above because that method probably doesn't do regex if (ZipArchivePattern != null && !string.IsNullOrWhiteSpace(ZipArchivePattern.ToString()) && !ZipArchivePattern.IsMatch(fileInfo.Name)) continue; diff --git a/Rdmp.Core/Logging/DataLoadInfo.cs b/Rdmp.Core/Logging/DataLoadInfo.cs index 64d00caa5a..f5b8b1fa43 100644 --- a/Rdmp.Core/Logging/DataLoadInfo.cs +++ b/Rdmp.Core/Logging/DataLoadInfo.cs @@ -345,8 +345,6 @@ public void LogProgress(ProgressEventType pevent, string Source, string Descript } lock (_logWaiter) - { Monitor.Pulse(_logWaiter); - } } -} \ No newline at end of file +} diff --git a/Rdmp.Core/MapsDirectlyToDatabaseTable/Versioning/Patcher.cs b/Rdmp.Core/MapsDirectlyToDatabaseTable/Versioning/Patcher.cs index 150fb256a9..dda270ebe9 100644 --- a/Rdmp.Core/MapsDirectlyToDatabaseTable/Versioning/Patcher.cs +++ b/Rdmp.Core/MapsDirectlyToDatabaseTable/Versioning/Patcher.cs @@ -78,7 +78,7 @@ public virtual Patch GetInitialCreateScriptContents(DiscoveredDatabase db) { var sr = new StreamReader(assembly.GetManifestResourceStream(candidates[0])); - var sql = sr.ReadToEnd(); + var sql = sr.ReadToEnd(); if (!sql.Contains(Patch.VersionKey)) sql = GetHeader(db.Server.DatabaseType, InitialScriptName, new Version(1, 0, 0)) + sql; diff --git a/Rdmp.Core/Providers/CatalogueChildProvider.cs b/Rdmp.Core/Providers/CatalogueChildProvider.cs index daece21254..30c7d55013 100644 --- a/Rdmp.Core/Providers/CatalogueChildProvider.cs +++ b/Rdmp.Core/Providers/CatalogueChildProvider.cs @@ -187,8 +187,8 @@ public class CatalogueChildProvider : ICoreChildProvider public JoinableCohortAggregateConfigurationUse[] AllJoinableCohortAggregateConfigurationUse { get; private set; } public AllPluginsNode AllPluginsNode { get; private set; } - public Plugin[] AllPlugins { get; private set; } - public Plugin[] AllCompatiblePlugins { get; private set; } + public Curation.Data.Plugin[] AllPlugins { get; private set; } + public Curation.Data.Plugin[] AllCompatiblePlugins { get; private set; } public HashSet PipelineUseCases { get; set; } = new(); @@ -432,7 +432,7 @@ public CatalogueChildProvider(ICatalogueRepository repository, IChildProvider[] ReportProgress("After Governance"); AllPluginsNode = new AllPluginsNode(); - AllPlugins = GetAllObjects(repository); + AllPlugins = GetAllObjects(repository); AllCompatiblePlugins = _catalogueRepository.PluginManager.GetCompatiblePlugins(); AddChildren(AllPluginsNode); diff --git a/Rdmp.Core/Rdmp.Core.csproj b/Rdmp.Core/Rdmp.Core.csproj index 666af91155..e34fd87426 100644 --- a/Rdmp.Core/Rdmp.Core.csproj +++ b/Rdmp.Core/Rdmp.Core.csproj @@ -371,9 +371,9 @@ - - + + diff --git a/Rdmp.Core/Repositories/CatalogueRepository.cs b/Rdmp.Core/Repositories/CatalogueRepository.cs index ea7e3eb40d..d35b20695f 100644 --- a/Rdmp.Core/Repositories/CatalogueRepository.cs +++ b/Rdmp.Core/Repositories/CatalogueRepository.cs @@ -29,7 +29,7 @@ using Rdmp.Core.Repositories.Managers; using Rdmp.Core.ReusableLibraryCode; using Rdmp.Core.ReusableLibraryCode.Comments; - + namespace Rdmp.Core.Repositories; /// @@ -96,7 +96,7 @@ public CatalogueRepository(DbConnectionStringBuilder catalogueConnectionString) Constructors.Add(typeof(StandardRegex), (rep, r) => new StandardRegex((ICatalogueRepository)rep, r)); Constructors.Add(typeof(AnyTableSqlParameter), (rep, r) => new AnyTableSqlParameter((ICatalogueRepository)rep, r)); - Constructors.Add(typeof(Plugin), (rep, r) => new Plugin((ICatalogueRepository)rep, r)); + Constructors.Add(typeof(Curation.Data.Plugin), (rep, r) => new Curation.Data.Plugin((ICatalogueRepository)rep, r)); Constructors.Add(typeof(ANOTable), (rep, r) => new ANOTable((ICatalogueRepository)rep, r)); Constructors.Add(typeof(AggregateConfiguration), (rep, r) => new AggregateConfiguration((ICatalogueRepository)rep, r)); diff --git a/Rdmp.Core/Repositories/MEF.cs b/Rdmp.Core/Repositories/MEF.cs index 00c692bbf6..4b102d0b09 100644 --- a/Rdmp.Core/Repositories/MEF.cs +++ b/Rdmp.Core/Repositories/MEF.cs @@ -146,7 +146,6 @@ public static string GetCSharpNameForType(Type t) if (t.GenericTypeArguments.Length != 1) throw new NotSupportedException( "Generic type has more than 1 token (e.g. T1,T2) so no idea what MEF would call it"); - var genericTypeName = t.GetGenericTypeDefinition().Name; Debug.Assert(genericTypeName.EndsWith("`1", StringComparison.Ordinal)); diff --git a/Rdmp.Core/Repositories/Managers/IPluginManager.cs b/Rdmp.Core/Repositories/Managers/IPluginManager.cs index eadba9d719..786780cf91 100644 --- a/Rdmp.Core/Repositories/Managers/IPluginManager.cs +++ b/Rdmp.Core/Repositories/Managers/IPluginManager.cs @@ -13,5 +13,5 @@ namespace Rdmp.Core.Repositories.Managers; /// public interface IPluginManager { - Plugin[] GetCompatiblePlugins(); + Curation.Data.Plugin[] GetCompatiblePlugins(); } \ No newline at end of file diff --git a/Rdmp.Core/Repositories/YamlRepository.cs b/Rdmp.Core/Repositories/YamlRepository.cs index 00f2d29a79..096e018a98 100644 --- a/Rdmp.Core/Repositories/YamlRepository.cs +++ b/Rdmp.Core/Repositories/YamlRepository.cs @@ -134,7 +134,7 @@ private void LoadObjects() private int ObjectDependencyOrder(Type arg) { // Load Plugin objects before dependent children - if (arg == typeof(Plugin)) + if (arg == typeof(Curation.Data.Plugin)) return 1; return arg == typeof(LoadModuleAssembly) ? 2 : 3; @@ -196,7 +196,7 @@ private string GetNupkgPath(LoadModuleAssembly lma) var path = Path.GetDirectoryName(GetPath(lma)); //somedir/LoadModuleAssembly/MyPlugin1.0.0.nupkg - return Path.Combine(path, GetObjectByID(lma.Plugin_ID).Name); + return Path.Combine(path, GetObjectByID(lma.Plugin_ID).Name); } public override void DeleteFromDatabase(IMapsDirectlyToDatabaseTable oTableWrapperObject) diff --git a/Rdmp.Core/ReusableLibraryCode/Settings/UserSettings.cs b/Rdmp.Core/ReusableLibraryCode/Settings/UserSettings.cs index eadc16b8ae..8beb4a92e8 100644 --- a/Rdmp.Core/ReusableLibraryCode/Settings/UserSettings.cs +++ b/Rdmp.Core/ReusableLibraryCode/Settings/UserSettings.cs @@ -27,6 +27,7 @@ public static class UserSettings "Isolated Storage does not work in this environment..."); + /// /// Show a Yes/No confirmation dialog box when closing RDMP /// diff --git a/Rdmp.Core/Sharing/Dependency/Gathering/Gatherer.cs b/Rdmp.Core/Sharing/Dependency/Gathering/Gatherer.cs index c9c545aec3..bf51a51dbb 100644 --- a/Rdmp.Core/Sharing/Dependency/Gathering/Gatherer.cs +++ b/Rdmp.Core/Sharing/Dependency/Gathering/Gatherer.cs @@ -33,7 +33,7 @@ public Gatherer(IRDMPPlatformRepositoryServiceLocator repositoryLocator) _functions.Add(typeof(Catalogue), o => GatherDependencies((Catalogue)o)); _functions.Add(typeof(ColumnInfo), o => GatherDependencies((ColumnInfo)o)); _functions.Add(typeof(ANOTable), o => GatherDependencies((ANOTable)o)); - _functions.Add(typeof(Plugin), o => GatherDependencies((Plugin)o)); + _functions.Add(typeof(Curation.Data.Plugin), o => GatherDependencies((Curation.Data.Plugin)o)); _functions.Add(typeof(LoadMetadata), o => GatherDependencies((LoadMetadata)o)); @@ -68,7 +68,7 @@ public static GatheredObject GatherDependencies(ANOTable anoTable) return root; } - public static GatheredObject GatherDependencies(Plugin plugin) + public static GatheredObject GatherDependencies(Curation.Data.Plugin plugin) { var root = new GatheredObject(plugin); diff --git a/Rdmp.Core/Validation/Validator.cs b/Rdmp.Core/Validation/Validator.cs index a41eb3ffda..ef52d788dc 100644 --- a/Rdmp.Core/Validation/Validator.cs +++ b/Rdmp.Core/Validation/Validator.cs @@ -431,7 +431,6 @@ private ValidationFailure ValidateAgainstDomainObject() break; } } - if (result != null) { result.SourceItemValidator ??= itemValidator; diff --git a/Rdmp.UI.Tests/DesignPatternTests/ClassFileEvaluation/SuspiciousRelationshipPropertyUse.cs b/Rdmp.UI.Tests/DesignPatternTests/ClassFileEvaluation/SuspiciousRelationshipPropertyUse.cs index 477eecfc1f..273f9af424 100644 --- a/Rdmp.UI.Tests/DesignPatternTests/ClassFileEvaluation/SuspiciousRelationshipPropertyUse.cs +++ b/Rdmp.UI.Tests/DesignPatternTests/ClassFileEvaluation/SuspiciousRelationshipPropertyUse.cs @@ -43,7 +43,7 @@ public void FindPropertyMisuse(List csFilesFound) continue; //Find the C sharp code for the class - var relationshipProperties = type.GetProperties().Where(p => p.CanRead && !p.CanWrite); + var relationshipProperties = type.GetProperties().Where(static p => p.CanRead && !p.CanWrite); var expectedFileName = $"{type.Name}.cs"; var files = csFilesFound diff --git a/Rdmp.UI.Tests/Rdmp.UI.Tests.csproj b/Rdmp.UI.Tests/Rdmp.UI.Tests.csproj index aaf0c150d5..23c4e115f5 100644 --- a/Rdmp.UI.Tests/Rdmp.UI.Tests.csproj +++ b/Rdmp.UI.Tests/Rdmp.UI.Tests.csproj @@ -1,37 +1,37 @@ - - net7.0-windows - false - true - embedded - true - NU1701 - true - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - - + + net7.0-windows + false + true + embedded + true + NU1701 + true + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + \ No newline at end of file diff --git a/Rdmp.UI/Collections/RDMPCollectionCommonFunctionality.cs b/Rdmp.UI/Collections/RDMPCollectionCommonFunctionality.cs index 29e52688a8..67554151dc 100644 --- a/Rdmp.UI/Collections/RDMPCollectionCommonFunctionality.cs +++ b/Rdmp.UI/Collections/RDMPCollectionCommonFunctionality.cs @@ -604,7 +604,6 @@ private Bitmap ImageGetter(object rowObject) return CoreIconProvider.GetImage(rowObject, hasProblems ? OverlayKind.Problem : OverlayKind.None) .ImageToBitmap(); - } /// diff --git a/Rdmp.UI/PipelineUIs/Pipelines/PipelineDiagramUI.cs b/Rdmp.UI/PipelineUIs/Pipelines/PipelineDiagramUI.cs index 6a1efae5c7..3a8ebb4c9d 100644 --- a/Rdmp.UI/PipelineUIs/Pipelines/PipelineDiagramUI.cs +++ b/Rdmp.UI/PipelineUIs/Pipelines/PipelineDiagramUI.cs @@ -201,10 +201,6 @@ public void SetTo(IPipeline pipeline, IPipelineUseCase useCase) return; } - - - //Fallback - //user has not picked a pipeline yet, show him the shell (factory) //factory has no source, add empty source if (_useCase.ExplicitSource == null) AddBlankComponent(PipelineComponentRole.Source); diff --git a/Rdmp.UI/SimpleControls/HeatmapUI.cs b/Rdmp.UI/SimpleControls/HeatmapUI.cs index ddfe5d093e..955433cf41 100644 --- a/Rdmp.UI/SimpleControls/HeatmapUI.cs +++ b/Rdmp.UI/SimpleControls/HeatmapUI.cs @@ -18,8 +18,8 @@ namespace Rdmp.UI.SimpleControls; /// /// Displays complicated many dimension pivot Aggregate graphs in an understandable format. Requires a result data table that contains an axis in the first column of hte data table -/// followed by any number (usually high e.g. 500+) additional columns which contain values that correspond to the axis. A typical usage of this control would be to display drug -/// prescriptions by month where there are thousands of different prescribeable drugs. +/// followed by any number (usually high e.g. 500+) additional columns which contain values that correspond to the axis. A typical usage of this control would be to display drug +/// prescriptions by month where there are thousands of different prescribeable drugs. /// /// The HeatmapUI renders each column as a row of heat map with each cell in the column as a 'pixel' (where the pixel width depends on the number of increments in the axis). The color /// of each pixel ranges from blue to red (with 0 appearing as black). The effect of this is to show the distribution of popular vs rare pivot values across time (or whatever the axis is). @@ -49,7 +49,7 @@ public partial class HeatmapUI : UserControl // Heat Lines | // Heat Lines | // Heat Lines | - // ... plot area | + // ... plot area | // | // | // | @@ -57,7 +57,7 @@ public partial class HeatmapUI : UserControl ////////////////////////////////////////////////////////////////////////////////////////////// - ///Table is interpreted in the following way: + ///Table is interpreted in the following way: /// - First column is the axis in direction X (horizontally) containing (in order) the axis label values that will be each pixel in each heat lane /// - Each subsequent column (HeatLine1, HeatLine2 etc above) is a horizontal line of the heatmap with each pixel intensity being determined by the value on the corresponding date (in the first column) private RainbowColorPicker _rainbow = new(NumberOfColors); @@ -68,7 +68,7 @@ public partial class HeatmapUI : UserControl private const double MaxLabelsWidth = 150; private const double LabelsHorizontalPadding = 10.0; - private double _currentLabelsWidth; + private double _currentLabelsWidth = 0; private object oDataTableLock = new(); @@ -120,16 +120,16 @@ public void SetDataTable(DataTable dataTable) _minValueInDataTable = double.MaxValue; for (var x = 0; x < _dataTable.Rows.Count; x++) - for (var y = 1; y < _dataTable.Columns.Count; y++) - { - var cellValue = ToDouble(_dataTable.Rows[x][y]); + for (var y = 1; y < _dataTable.Columns.Count; y++) + { + var cellValue = ToDouble(_dataTable.Rows[x][y]); - if (cellValue < _minValueInDataTable) - _minValueInDataTable = cellValue; + if (cellValue < _minValueInDataTable) + _minValueInDataTable = cellValue; - if (cellValue > _maxValueInDataTable) - _maxValueInDataTable = cellValue; - } + if (cellValue > _maxValueInDataTable) + _maxValueInDataTable = cellValue; + } Height = (int)Math.Max(Height, _dataTable.Columns.Count * MinPixelHeight); } @@ -153,13 +153,12 @@ protected override void OnResize(EventArgs e) Invalidate(); } - private ToolTip tt = new(); private int toolTipDelayInTicks = 500; private Point _lastHoverPoint; private int _lastHoverTickCount; - private bool _useEntireControlAsVisibleArea; + private bool _useEntireControlAsVisibleArea = false; private void hoverToolTipTimer_Tick(object sender, EventArgs e) @@ -226,9 +225,11 @@ private object GetValueFromClientPosition(Point pos) if (dataTableRow >= _dataTable.Rows.Count) return _dataTable.Columns[dataTableCol].ColumnName; - return dataTableCol == 0 - ? _dataTable.Rows[dataTableRow][dataTableCol] - : $"{_dataTable.Rows[dataTableRow][0]}:{_dataTable.Columns[dataTableCol].ColumnName}{Environment.NewLine}{_dataTable.Rows[dataTableRow][dataTableCol]}"; + if (dataTableCol == 0) + return _dataTable.Rows[dataTableRow][dataTableCol]; + + return + $"{_dataTable.Rows[dataTableRow][0]}:{_dataTable.Columns[dataTableCol].ColumnName}{Environment.NewLine}{_dataTable.Rows[dataTableRow][dataTableCol]}"; } protected override void OnPaint(PaintEventArgs e) @@ -264,30 +265,30 @@ protected override void OnPaint(PaintEventArgs e) for (var x = 0; x < _dataTable.Rows.Count; x++) //draw the line this way -------------> with pixels of width heatPixelWidth/Height //skip the first y value which is the x axis value - for (var y = 1; y < _dataTable.Columns.Count; y++) + for (var y = 1; y < _dataTable.Columns.Count; y++) + { + //the value we are drawing + var cellValue = ToDouble(_dataTable.Rows[x][y]); + + //if the cell value is 0 render it as black + if (Math.Abs(cellValue - _minValueInDataTable) < 0.0000000001 && + Math.Abs(_minValueInDataTable) < 0.0000000001) + { + brush.Color = Color.Black; + } + else { - //the value we are drawing - var cellValue = ToDouble(_dataTable.Rows[x][y]); - - //if the cell value is 0 render it as black - if (Math.Abs(cellValue - _minValueInDataTable) < 0.0000000001 && - Math.Abs(_minValueInDataTable) < 0.0000000001) - { - brush.Color = Color.Black; - } - else - { - var brightness = (cellValue - _minValueInDataTable) / - (_maxValueInDataTable - _minValueInDataTable); - var brightnessIndex = (int)(brightness * (NumberOfColors - 1)); - - brush.Color = _rainbow.Colors[brightnessIndex]; - } - - e.Graphics.FillRectangle(brush, (float)(x * heatPixelWidth), (float)(y * heatPixelHeight), - (float)heatPixelWidth, (float)heatPixelHeight); + var brightness = (cellValue - _minValueInDataTable) / + (_maxValueInDataTable - _minValueInDataTable); + var brightnessIndex = (int)(brightness * (NumberOfColors - 1)); + + brush.Color = _rainbow.Colors[brightnessIndex]; } + e.Graphics.FillRectangle(brush, (float)(x * heatPixelWidth), (float)(y * heatPixelHeight), + (float)heatPixelWidth, (float)heatPixelHeight); + } + var labelStartX = Width - _currentLabelsWidth; @@ -312,7 +313,7 @@ protected override void OnPaint(PaintEventArgs e) var visibleClipBoundsTop = visibleArea.Top; - //now draw the axis + //now draw the axis //axis starts at the first visible pixel double axisYStart = Math.Max(0, visibleClipBoundsTop); diff --git a/Rdmp.UI/Validation/SecondaryConstraintUI.cs b/Rdmp.UI/Validation/SecondaryConstraintUI.cs index f73062f840..a8fd246343 100644 --- a/Rdmp.UI/Validation/SecondaryConstraintUI.cs +++ b/Rdmp.UI/Validation/SecondaryConstraintUI.cs @@ -56,7 +56,7 @@ public partial class SecondaryConstraintUI : UserControl internal event RequestDeletionHandler RequestDeletion; - private bool loadingComplete; + private bool loadingComplete = false; public SecondaryConstraintUI(ICatalogueRepository repository, SecondaryConstraint secondaryConstriant, string[] otherColumns) @@ -131,17 +131,15 @@ public SecondaryConstraintUI(ICatalogueRepository repository, SecondaryConstrain else if (_requiredProperties[i].PropertyType == typeof(PredictionRule)) //Hard Typed property PredictionRule { //for prediction rules fields - var cbx = new ComboBox - { - DropDownStyle = ComboBoxStyle.DropDownList, - DisplayMember = "Name", - Tag = i, - Width = 200 - }; + var cbx = new ComboBox(); cbx.Items.AddRange(Validator.GetPredictionExtraTypes()); cbx.Items.Add(""); + cbx.DropDownStyle = ComboBoxStyle.DropDownList; + cbx.DisplayMember = "Name"; + cbx.Tag = i; cbx.SelectedIndexChanged += (s, e) => _requiredProperties[(int)cbx.Tag].SetValue(SecondaryConstriant, cbx.SelectedItem is Type type ? Activator.CreateInstance(type) : null); + cbx.Width = 200; //The dropdown box is a list of Types but we are actually instantiating a value when user selects it (for XML Serialization). Consequently we must now get the Type for selection purposes if (currentValue != null) @@ -161,18 +159,16 @@ public SecondaryConstraintUI(ICatalogueRepository repository, SecondaryConstrain if (_requiredProperties[i].IsDefined(typeof(ExpectsColumnNameAsInput), true)) { //for column fields - var cbx = new ComboBox - { - DropDownStyle = ComboBoxStyle.DropDownList, - Tag = i, - Width = 350 - }; + var cbx = new ComboBox(); cbx.Items.AddRange(_otherColumns); cbx.Items.Add(""); + cbx.DropDownStyle = ComboBoxStyle.DropDownList; + cbx.Tag = i; cbx.SelectedIndexChanged += (s, e) => _requiredProperties[(int)cbx.Tag].SetValue(SecondaryConstriant, UsefulStuff.ChangeType(cbx.SelectedItem, _requiredProperties[(int)cbx.Tag].PropertyType), null); + cbx.Width = 350; valueControl = cbx; } @@ -209,10 +205,10 @@ public SecondaryConstraintUI(ICatalogueRepository repository, SecondaryConstrain } //See if it has a value + var v = _requiredProperties[i].GetValue(SecondaryConstriant, null) as IRevertable; //It has a value, this is a dropdown control right here though so if the revertable state out of date then it means someone else made a change to the database while we were picking columns - if (_requiredProperties[i].GetValue(SecondaryConstriant, null) is IRevertable v) - v.RevertToDatabaseState(); + v?.RevertToDatabaseState(); valueControl = dd; } diff --git a/SharedAssemblyInfo.cs b/SharedAssemblyInfo.cs index 117116904b..0526570827 100644 --- a/SharedAssemblyInfo.cs +++ b/SharedAssemblyInfo.cs @@ -12,4 +12,4 @@ [assembly: AssemblyVersion("8.1.0")] [assembly: AssemblyFileVersion("8.1.0")] -[assembly: AssemblyInformationalVersion("8.1.0-rc4")] \ No newline at end of file +[assembly: AssemblyInformationalVersion("8.1.0-rc4")] diff --git a/Tests.Common/DatabaseTests.cs b/Tests.Common/DatabaseTests.cs index 7f95cac901..ea452de3c9 100644 --- a/Tests.Common/DatabaseTests.cs +++ b/Tests.Common/DatabaseTests.cs @@ -394,7 +394,7 @@ private void BlitzMainDataTables(YamlRepository y) DeleteAll(y); DeleteAll(y); - DeleteAll(y); + DeleteAll(y); DeleteAll(y); DeleteAll(y); diff --git a/Tests.Common/Tests.Common.csproj b/Tests.Common/Tests.Common.csproj index 09f7b1fdcb..a6135ad0cb 100644 --- a/Tests.Common/Tests.Common.csproj +++ b/Tests.Common/Tests.Common.csproj @@ -1,47 +1,47 @@ - - HIC.RDMP.Plugin.Test - $(version) - HIC.RDMP.Plugin.Test - net7.0 - Health Informatics Centre, University of Dundee - Health Informatics Centre, University of Dundee - https://raw.githubusercontent.com/HicServices/RDMP/master/LICENSE - https://github.com/HicServices/RDMP - - https://raw.githubusercontent.com/HicServices/RDMP/master/Application/ResearchDataManagementPlatform/Icon/main.png - false - GPL-3.0-or-later - Package for writing plugin tests - Copyright 2018-2019 - false - true - 1701;1702;CS1591 - embedded - true - true - - - - - - - - - - PreserveNewest - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - + + HIC.RDMP.Plugin.Test + $(version) + HIC.RDMP.Plugin.Test + net7.0 + Health Informatics Centre, University of Dundee + Health Informatics Centre, University of Dundee + https://raw.githubusercontent.com/HicServices/RDMP/master/LICENSE + https://github.com/HicServices/RDMP + + https://raw.githubusercontent.com/HicServices/RDMP/master/Application/ResearchDataManagementPlatform/Icon/main.png + false + GPL-3.0-or-later + Package for writing plugin tests + Copyright 2018-2019 + false + true + 1701;1702;CS1591 + embedded + true + true + + + + + + + + + + PreserveNewest + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + \ No newline at end of file diff --git a/Tests.Common/UnitTests.cs b/Tests.Common/UnitTests.cs index 903ef5cd18..d320f3cc74 100644 --- a/Tests.Common/UnitTests.cs +++ b/Tests.Common/UnitTests.cs @@ -105,7 +105,7 @@ protected virtual void SetUp() /// Type of object you want to create /// /// If there is not yet an implementation for the given T. Feel free to write one. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + //[MethodImpl(MethodImplOptions.AggressiveInlining)] protected T WhenIHaveA() where T : DatabaseEntity => WhenIHaveA(Repository); @@ -270,8 +270,8 @@ public static T WhenIHaveA(MemoryDataExportRepository repository) where T : D return (T)(object)joinable.AddUser(config); } - if (typeof(T) == typeof(Plugin)) - return (T)(object)new Plugin(repository, new FileInfo("bob.nupkg"), new Version(1, 1, 1), + if (typeof(T) == typeof(Rdmp.Core.Curation.Data.Plugin)) + return (T)(object)new Rdmp.Core.Curation.Data.Plugin(repository, new FileInfo("bob.nupkg"), new Version(1, 1, 1), new Version(1, 1, 1)); if (typeof(T) == typeof(LoadModuleAssembly)) @@ -279,7 +279,7 @@ public static T WhenIHaveA(MemoryDataExportRepository repository) where T : D var dll = Path.Combine(TestContext.CurrentContext.TestDirectory, "a.nupkg"); File.WriteAllBytes(dll, new byte[] { 0x11 }); - return (T)(object)new LoadModuleAssembly(repository, new FileInfo(dll), WhenIHaveA(repository)); + return (T)(object)new LoadModuleAssembly(repository, new FileInfo(dll), WhenIHaveA(repository)); } if (typeof(T) == typeof(AggregateContinuousDateAxis)) diff --git a/Tools/rdmp/rdmp.csproj b/Tools/rdmp/rdmp.csproj index 7de92697d4..aba8a4e229 100644 --- a/Tools/rdmp/rdmp.csproj +++ b/Tools/rdmp/rdmp.csproj @@ -44,9 +44,9 @@ all runtime; build; native; contentfiles; analyzers - + - +