Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/rdmp 34 chi ingress #1688

Closed
wants to merge 76 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
c3e1ce6
add chi column finder
JFriel Nov 27, 2023
aa43931
basic redaction commands
JFriel Nov 27, 2023
405f076
add start of mutilator
JFriel Nov 27, 2023
35735ae
basic working dl
JFriel Nov 28, 2023
0b4b4cb
basic ui
JFriel Nov 28, 2023
50fd26f
make start on ui
JFriel Nov 28, 2023
f235070
basic ui
JFriel Nov 28, 2023
6a30d94
fix namespace
JFriel Nov 28, 2023
44fb9be
remove hicplugin reference
JFriel Nov 29, 2023
37746fa
fix file documentation
JFriel Nov 29, 2023
ae8116e
fix up tests
JFriel Nov 29, 2023
3ceb878
use correct list
JFriel Nov 29, 2023
5a8eeeb
add file extention
JFriel Nov 29, 2023
f0466e3
add ignore strings
JFriel Nov 29, 2023
6cf5173
change visability
JFriel Nov 29, 2023
b6a2848
add missing headers
JFriel Nov 29, 2023
1967a73
update unit test
JFriel Nov 29, 2023
4a7ad53
add creation db code
JFriel Nov 29, 2023
63e2e2e
try no params
JFriel Nov 29, 2023
8ccde9d
update test
JFriel Nov 29, 2023
bdea723
temp
JFriel Nov 30, 2023
15e90db
update redacted chi
JFriel Nov 30, 2023
b910bac
updated data load
JFriel Dec 4, 2023
e9cce51
working restore
JFriel Dec 4, 2023
135288f
working identify
JFriel Dec 4, 2023
0857816
fix mutilator
JFriel Dec 5, 2023
3d0a741
working redaction
JFriel Dec 5, 2023
99f660e
readd command execution
JFriel Dec 5, 2023
02fc8c2
working redaction
JFriel Dec 5, 2023
e938313
start of the dqe
JFriel Dec 5, 2023
4528aee
document files
JFriel Dec 5, 2023
efa7312
add rdmp all ignore
JFriel Dec 5, 2023
fa89202
Merge branch 'develop' of https://github.com/HicServices/RDMP into fe…
JFriel Dec 11, 2023
da567f7
attempt to fix sql
JFriel Dec 11, 2023
6a7e640
dont redact pks
JFriel Dec 11, 2023
1245852
add early return
JFriel Dec 11, 2023
c950bae
working confirm all
JFriel Dec 12, 2023
9916d7f
tidy up ui
JFriel Dec 12, 2023
d5d9468
update kn issue
JFriel Dec 12, 2023
61a0bf8
make a start on tests
JFriel Dec 12, 2023
90643ca
Merge branch 'develop' of https://github.com/HicServices/RDMP into fe…
JFriel Dec 13, 2023
020c11f
add find tests
JFriel Dec 13, 2023
65c1500
redact chi test
JFriel Dec 13, 2023
22dbd14
update tests
JFriel Dec 13, 2023
ab0ad56
update tests
JFriel Dec 13, 2023
efafd0e
remove prohibited word
JFriel Dec 13, 2023
87a66d3
tidy up code
JFriel Dec 13, 2023
eabe955
comment out test for build testing purposes
JFriel Dec 13, 2023
8307a73
update tests
JFriel Dec 14, 2023
d5520b8
working test
JFriel Dec 14, 2023
fa38a4d
Merge branch 'develop' of https://github.com/HicServices/RDMP into fe…
JFriel Dec 15, 2023
cbad896
add no results found label
JFriel Dec 15, 2023
6919c17
tidy up from codeql
JFriel Dec 15, 2023
707bf8e
add missing file
JFriel Dec 15, 2023
ce1d347
Merge branch 'develop' of https://github.com/HicServices/RDMP into fe…
JFriel Dec 18, 2023
2c36e42
fix csproj
JFriel Dec 18, 2023
d75eddc
fix build
JFriel Dec 18, 2023
886010e
improved multi dataset catalogue
JFriel Dec 18, 2023
1c87027
start to dedupe code
JFriel Dec 18, 2023
40c6218
add summaries
JFriel Dec 18, 2023
bae18fb
tidy up code
JFriel Dec 18, 2023
196e83c
add missed elper useage
JFriel Dec 18, 2023
d1cb089
fix overcorrection
JFriel Dec 18, 2023
775bcaf
remove pipes
JFriel Dec 18, 2023
f79312e
Merge branch 'develop' into feature/RDMP-34-chi-ingress
JFriel Dec 19, 2023
f55e42e
Merge branch 'develop' of https://github.com/HicServices/RDMP into fe…
JFriel Jan 3, 2024
df1f918
Dispose to using fixups
Jan 3, 2024
b4e4160
Variable scope fix
Jan 3, 2024
701e484
Variable scope fix 2
Jan 3, 2024
266c13a
Merge branch 'develop' into feature/RDMP-34-chi-ingress
JFriel Jan 10, 2024
e9edfce
Merge branch 'develop' of https://github.com/HicServices/RDMP into fe…
JFriel Jan 22, 2024
b8f2372
Merge branch 'develop' into feature/RDMP-34-chi-ingress
JFriel Feb 1, 2024
8914090
Merge branch 'develop' into feature/RDMP-34-chi-ingress
JFriel Feb 5, 2024
5613b5a
Merge branch 'develop' of https://github.com/HicServices/RDMP into fe…
JFriel Mar 27, 2024
d538d68
Merge branch 'develop' of https://github.com/HicServices/RDMP into fe…
JFriel Apr 30, 2024
ebc9e41
update ui
JFriel Apr 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@
<ItemGroup>
<ProjectReference Include="..\..\Rdmp.UI\Rdmp.UI.csproj" />
</ItemGroup>
</Project>
</Project>
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@


# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [8.1.6] = Unreleased
## [8.2.0] - Unreleased

## Changed

- Add ability to redact CHI values on daata load and to redact existing catalogues

## [8.1.6] - Unreleased

## Changed

- Add Microsoft.Bcl.AsyncInterfaces 6.0.0 for plugin dependancy tree
- Add prompt to reanem container when adding a cohort filter
- Add prompt to rename container when adding a cohort filter

## [8.1.5] - 2024-04-03

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using NUnit.Framework;
using Rdmp.Core.CommandExecution;
using Rdmp.Core.CommandExecution.AtomicCommands;
using Rdmp.Core.Curation.Data;
using Tests.Common;

namespace Rdmp.Core.Tests.CommandExecution;

internal class ExecuteCommandConfirmRedactedCHITests: DatabaseTests
{
[Test]
public void ConfirmRedactedCHI_Valid() {
var redactedChisCount = CatalogueRepository.GetAllObjects<RedactedCHI>().Length;
var rCHI = new RedactedCHI(CatalogueRepository, "1111111111", 0, "[fake].[table]","pkValue","[pkColumn]","[columnName]");
rCHI.SaveToDatabase();

var cmd = new ExecuteCommandConfirmRedactedCHI(new ThrowImmediatelyActivator(RepositoryLocator), rCHI);
Assert.DoesNotThrow(()=> cmd.Execute());
Assert.That(redactedChisCount, Is.EqualTo(CatalogueRepository.GetAllObjects<RedactedCHI>().Length));
}

[Test]
public void ConfirmRedactedCHI_InValid() {
var redactedChisCount = CatalogueRepository.GetAllObjects<RedactedCHI>().Length;
var rCHI = new RedactedCHI(CatalogueRepository, "1111111111", 0, "[fake].[table]", "pkValue", "[pkColumn]", "[columnName]");
rCHI.DeleteInDatabase();

var cmd = new ExecuteCommandConfirmRedactedCHI(new ThrowImmediatelyActivator(RepositoryLocator), rCHI);
Assert.DoesNotThrow(() => cmd.Execute());
Assert.That(redactedChisCount, Is.EqualTo(CatalogueRepository.GetAllObjects<RedactedCHI>().Length));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
using NUnit.Framework;
using Rdmp.Core.CommandExecution;
using Rdmp.Core.CommandExecution.AtomicCommands;
using Rdmp.Core.CommandLine.DatabaseCreation;
using Rdmp.Core.Curation.Data;
using Rdmp.Core.ReusableLibraryCode.Checks;
using System.IO;
using System.Linq;
using Tests.Common;

namespace Rdmp.Core.Tests.CommandExecution;

internal class ExecuteCommandIdentifyCHIInCatalogueTests : DatabaseTests
{

[Test]
public void IdentifyCHIInCatalogue_Correct()
{
var db = GetCleanedServer(FAnsi.DatabaseType.MicrosoftSQLServer);
var pipes = new CataloguePipelinesAndReferencesCreation(RepositoryLocator, null, null);
pipes.CreatePipelines(new PlatformDatabaseCreationOptions());
var creator = new ExampleDatasetsCreation(new ThrowImmediatelyActivator(RepositoryLocator), RepositoryLocator);
creator.Create(db, ThrowImmediatelyCheckNotifier.Quiet,
new PlatformDatabaseCreationOptions { Seed = 500, DropDatabases = true });
var biochemistry = CatalogueRepository.GetAllObjects<Catalogue>().Where(c => c.Name == "Biochemistry").First();
var cmd = new ExecuteCommandIdentifyCHIInCatalogue(new ThrowImmediatelyActivator(RepositoryLocator), biochemistry, false, null);
Assert.DoesNotThrow(() => cmd.Execute());
Assert.That(cmd.foundChis.Rows.Count, Is.EqualTo(0));
}

[Test]
public void IdentifyCHIInCatalogue_FoundCHI()
{
var db = GetCleanedServer(FAnsi.DatabaseType.MicrosoftSQLServer);
var creator = new ExampleDatasetsCreation(new ThrowImmediatelyActivator(RepositoryLocator), RepositoryLocator);
creator.Create(db, ThrowImmediatelyCheckNotifier.Quiet,
new PlatformDatabaseCreationOptions { Seed = 500, DropDatabases = true });


var tbl = db.DiscoverTables(true).Where(dt => dt.GetRuntimeName().Contains("Biochemistry")).First();
var updateSQL = $"UPDATE top (2) {tbl.GetRuntimeName()} set SampleType = '1111111111'";
using (var con = tbl.Database.Server.GetConnection())
{
con.Open();
var updateCmd = tbl.Database.Server.GetCommand(updateSQL, con);
updateCmd.ExecuteNonQuery();
}

var biochemistry = CatalogueRepository.GetAllObjects<Catalogue>().Where(c => c.Name == "Biochemistry").First();
var cmd = new ExecuteCommandIdentifyCHIInCatalogue(new ThrowImmediatelyActivator(RepositoryLocator), biochemistry, false, null);
Assert.DoesNotThrow(() => cmd.Execute());
Assert.That(cmd.foundChis.Rows.Count, Is.EqualTo(2));
}

[Test]
public void IdentifyCHIInCatalogue_FoundCHI_BailOuit()
{
var db = GetCleanedServer(FAnsi.DatabaseType.MicrosoftSQLServer);
var creator = new ExampleDatasetsCreation(new ThrowImmediatelyActivator(RepositoryLocator), RepositoryLocator);
creator.Create(db, ThrowImmediatelyCheckNotifier.Quiet,
new PlatformDatabaseCreationOptions { Seed = 500, DropDatabases = true });


var tbl = db.DiscoverTables(true).Where(dt => dt.GetRuntimeName().Contains("Biochemistry")).First();
var updateSQL = $"UPDATE top (2) {tbl.GetRuntimeName()} set SampleType = '1111111111'";
using (var con = tbl.Database.Server.GetConnection())
{
con.Open();
var updateCmd = tbl.Database.Server.GetCommand(updateSQL, con);
updateCmd.ExecuteNonQuery();
}

var biochemistry = CatalogueRepository.GetAllObjects<Catalogue>().Where(c => c.Name == "Biochemistry").First();
var cmd = new ExecuteCommandIdentifyCHIInCatalogue(new ThrowImmediatelyActivator(RepositoryLocator), biochemistry, true, null);
Assert.DoesNotThrow(() => cmd.Execute());
Assert.That(cmd.foundChis.Rows.Count, Is.EqualTo(1));
}

[Test]
public void IdentifyCHIInCatalogue_FoundCHI_AllowList()
{
var db = GetCleanedServer(FAnsi.DatabaseType.MicrosoftSQLServer);
var creator = new ExampleDatasetsCreation(new ThrowImmediatelyActivator(RepositoryLocator), RepositoryLocator);
creator.Create(db, ThrowImmediatelyCheckNotifier.Quiet,
new PlatformDatabaseCreationOptions { Seed = 500, DropDatabases = true });


var tbl = db.DiscoverTables(true).Where(dt => dt.GetRuntimeName().Contains("Biochemistry")).First();
var updateSQL = $"UPDATE top (2) {tbl.GetRuntimeName()} set SampleType = '1111111111'";
using (var con = tbl.Database.Server.GetConnection())
{
con.Open();
var updateCmd = tbl.Database.Server.GetCommand(updateSQL, con);
updateCmd.ExecuteNonQuery();
}

var biochemistry = CatalogueRepository.GetAllObjects<Catalogue>().Where(c => c.Name == "Biochemistry").First();
var tempFileToCreate = Path.Combine(TestContext.CurrentContext.TestDirectory, "allowList.yaml");
var allowList = File.Create(tempFileToCreate);
allowList.Close();
File.WriteAllLines(tempFileToCreate, new string[] { "Biochemistry:", "- SampleType" });
var cmd = new ExecuteCommandIdentifyCHIInCatalogue(new ThrowImmediatelyActivator(RepositoryLocator), biochemistry, false, tempFileToCreate);
Assert.DoesNotThrow(() => cmd.Execute());
Assert.That(cmd.foundChis.Rows.Count, Is.EqualTo(0));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
using NUnit.Framework;
using Rdmp.Core.CommandExecution;
using Rdmp.Core.CommandExecution.AtomicCommands;
using Rdmp.Core.CommandLine.DatabaseCreation;
using Rdmp.Core.Curation.Data;
using Rdmp.Core.ReusableLibraryCode.Checks;
using System.Data;
using System.IO;
using System.Linq;
using Tests.Common;

namespace Rdmp.Core.Tests.CommandExecution;

internal class ExecuteCommandRedactCHIsFromCatalogueTests: DatabaseTests
{

[Test]
public void RedactCHIsFromCatalogue_ValidSingle()
{
var db = GetCleanedServer(FAnsi.DatabaseType.MicrosoftSQLServer);
var creator = new ExampleDatasetsCreation(new ThrowImmediatelyActivator(RepositoryLocator), RepositoryLocator);
creator.Create(db, ThrowImmediatelyCheckNotifier.Quiet,
new PlatformDatabaseCreationOptions { Seed = 500, DropDatabases = true });
var biochemistry = CatalogueRepository.GetAllObjects<Catalogue>().Where(c => c.Name == "Biochemistry").First();
var tbl = db.DiscoverTables(true).Where(dt => dt.GetRuntimeName().Contains("Biochemistry")).First();
var updateSQL = $"UPDATE top (2) {tbl.GetRuntimeName()} set SampleType = 'F1111111111'";
using var con = tbl.Database.Server.GetConnection();
con.Open();
var updateCmd = tbl.Database.Server.GetCommand(updateSQL, con);
updateCmd.ExecuteNonQuery();
var cmd = new ExecuteCommandRedactCHIsFromCatalogue(new ThrowImmediatelyActivator(RepositoryLocator), biochemistry, null);
Assert.DoesNotThrow(() => cmd.Execute());
using var dt = new DataTable();
using var findCmd = tbl.Database.Server.GetCommand($"select * from {tbl.GetRuntimeName()} where SampleType = 'F#########1'", con);
using var da = tbl.Database.Server.GetDataAdapter(findCmd);
da.Fill(dt);
Assert.That(dt.Rows.Count, Is.EqualTo(2));
}

[Test]
public void RedactCHIsFromCatalogue_Allowlist()
{
var db = GetCleanedServer(FAnsi.DatabaseType.MicrosoftSQLServer);
var pipes = new CataloguePipelinesAndReferencesCreation(RepositoryLocator, null, null);
pipes.CreatePipelines(new PlatformDatabaseCreationOptions());
var creator = new ExampleDatasetsCreation(new ThrowImmediatelyActivator(RepositoryLocator), RepositoryLocator);
creator.Create(db, ThrowImmediatelyCheckNotifier.Quiet,
new PlatformDatabaseCreationOptions { Seed = 500, DropDatabases = true });
var biochemistry = CatalogueRepository.GetAllObjects<Catalogue>().Where(c => c.Name == "Biochemistry").First();
var tbl = db.DiscoverTables(true).Where(dt => dt.GetRuntimeName().Contains("Biochemistry")).First();
var updateSQL = $"UPDATE top (2) {tbl.GetRuntimeName()} set SampleType = 'F1111111111'";
using var con = tbl.Database.Server.GetConnection();
con.Open();
var updateCmd = tbl.Database.Server.GetCommand(updateSQL, con);
updateCmd.ExecuteNonQuery();
var tempFileToCreate = Path.Combine(TestContext.CurrentContext.TestDirectory, "allowList.yaml");
var allowList = File.Create(tempFileToCreate);
allowList.Close();
File.WriteAllLines(tempFileToCreate, new string[] { "Biochemistry:", "- SampleType" });
var cmd = new ExecuteCommandRedactCHIsFromCatalogue(new ThrowImmediatelyActivator(RepositoryLocator), biochemistry, tempFileToCreate);
Assert.DoesNotThrow(() => cmd.Execute());
using var dt = new DataTable();
using var findCmd = tbl.Database.Server.GetCommand($"select * from {tbl.GetRuntimeName()} where SampleType = 'F#########1'", con);
using var da = tbl.Database.Server.GetDataAdapter(findCmd);
da.Fill(dt);
Assert.That(dt.Rows.Count, Is.EqualTo(0));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
using NUnit.Framework;
using Rdmp.Core.CommandExecution.AtomicCommands;
using Rdmp.Core.CommandExecution;
using Rdmp.Core.Curation.Data;
using System.Linq;
using Tests.Common;
using Rdmp.Core.CommandLine.DatabaseCreation;
using Rdmp.Core.ReusableLibraryCode.Checks;
using System.Data;
using System;

namespace Rdmp.Core.Tests.CommandExecution;

internal class ExecuteCommandRevertRedactedCHITests : DatabaseTests
{
[Test]
public void RevertRedactedCHI_Valid()
{
var db = GetCleanedServer(FAnsi.DatabaseType.MicrosoftSQLServer);
var creator = new ExampleDatasetsCreation(new ThrowImmediatelyActivator(RepositoryLocator), RepositoryLocator);
creator.Create(db, ThrowImmediatelyCheckNotifier.Quiet,
new PlatformDatabaseCreationOptions { Seed = 500, DropDatabases = true });
var biochemistry = CatalogueRepository.GetAllObjects<Catalogue>().Where(c => c.Name == "Biochemistry").First();
var tbl = db.DiscoverTables(true).Where(dt => dt.GetRuntimeName().Contains("Biochemistry")).First();
var updateSQL = $"UPDATE top (1) {tbl.GetRuntimeName()} set SampleType = 'R1111111111'";
using (var con = tbl.Database.Server.GetConnection())
{
con.Open();
var updateCmd = tbl.Database.Server.GetCommand(updateSQL, con);
updateCmd.ExecuteNonQuery();
}
var cmd = new ExecuteCommandRedactCHIsFromCatalogue(new ThrowImmediatelyActivator(RepositoryLocator), biochemistry, null);
Assert.DoesNotThrow(() => cmd.Execute());
var dt = new DataTable();

Check warning

Code scanning / CodeQL

Missing Dispose call on local IDisposable Warning

Disposable 'DataTable' is created but not disposed.
using (var con = tbl.Database.Server.GetConnection())
{
using (var findCmd = tbl.Database.Server.GetCommand($"select * from {tbl.GetRuntimeName()} where SampleType = 'R#########1'", con))
{
using var da = tbl.Database.Server.GetDataAdapter(findCmd);
da.Fill(dt);
}
}
Assert.That(dt.Rows.Count, Is.EqualTo(1));
var redactedChisCount = CatalogueRepository.GetAllObjects<RedactedCHI>().Length;
var rCHI = CatalogueRepository.GetAllObjects<RedactedCHI>().First();
var revertCmd = new ExecuteCommandRevertRedactedCHI(new ThrowImmediatelyActivator(RepositoryLocator), rCHI);
Assert.DoesNotThrow(() => revertCmd.Execute());
Assert.That(redactedChisCount, Is.EqualTo(CatalogueRepository.GetAllObjects<RedactedCHI>().Length +1));
dt = new DataTable();
using (var con = tbl.Database.Server.GetConnection())
{
using (var findCmd = tbl.Database.Server.GetCommand($"select * from {tbl.GetRuntimeName()} where SampleType = 'R1111111111'", con))
{
using var da = tbl.Database.Server.GetDataAdapter(findCmd);
da.Fill(dt);
}
}
Assert.That(dt.Rows.Count, Is.EqualTo(1));
dt.Dispose();

Check warning

Code scanning / CodeQL

Dispose may not be called if an exception is thrown during execution Warning

Dispose missed if exception is thrown by
call to method GetConnection
.
Dispose missed if exception is thrown by
call to method GetCommand
.
Dispose missed if exception is thrown by
call to method GetRuntimeName
.
Dispose missed if exception is thrown by
call to method GetDataAdapter
.
Dispose missed if exception is thrown by
call to method Fill
.
Dispose missed if exception is thrown by
call to method That
.
Dispose missed if exception is thrown by
call to method EqualTo
.
}

[Test]
public void RevertRedactedCHI_InValid()
{
var db = GetCleanedServer(FAnsi.DatabaseType.MicrosoftSQLServer);
var pipes = new CataloguePipelinesAndReferencesCreation(RepositoryLocator, null, null);
pipes.CreatePipelines(new PlatformDatabaseCreationOptions());
var creator = new ExampleDatasetsCreation(new ThrowImmediatelyActivator(RepositoryLocator), RepositoryLocator);
creator.Create(db, ThrowImmediatelyCheckNotifier.Quiet,
new PlatformDatabaseCreationOptions { Seed = 500, DropDatabases = true });
var biochemistry = CatalogueRepository.GetAllObjects<Catalogue>().Where(c => c.Name == "Biochemistry").First();
var tbl = db.DiscoverTables(true).Where(dt => dt.GetRuntimeName().Contains("Biochemistry")).First();
var updateSQL = $"UPDATE top (1) {tbl.GetRuntimeName()} set SampleType = 'R1111111111'";
using (var con = tbl.Database.Server.GetConnection())
{
con.Open();
var updateCmd = tbl.Database.Server.GetCommand(updateSQL, con);
updateCmd.ExecuteNonQuery();
}
var cmd = new ExecuteCommandRedactCHIsFromCatalogue(new ThrowImmediatelyActivator(RepositoryLocator), biochemistry, null);
Assert.DoesNotThrow(() => cmd.Execute());
var dt = new DataTable();
using (var con = tbl.Database.Server.GetConnection())
{
using (var findCmd = tbl.Database.Server.GetCommand($"select * from {tbl.GetRuntimeName()} where SampleType = 'R#########1'", con))
{
using var da = tbl.Database.Server.GetDataAdapter(findCmd);
da.Fill(dt);
}
}
Assert.That(dt.Rows.Count, Is.EqualTo(1));
dt.Dispose();

Check warning

Code scanning / CodeQL

Dispose may not be called if an exception is thrown during execution Warning

Dispose missed if exception is thrown by
call to method GetConnection
.
Dispose missed if exception is thrown by
call to method GetCommand
.
Dispose missed if exception is thrown by
call to method GetRuntimeName
.
Dispose missed if exception is thrown by
call to method GetDataAdapter
.
Dispose missed if exception is thrown by
call to method Fill
.
Dispose missed if exception is thrown by
call to method That
.
Dispose missed if exception is thrown by
call to method EqualTo
.
var redactedChisCount = CatalogueRepository.GetAllObjects<RedactedCHI>().Length;
var rCHI = CatalogueRepository.GetAllObjects<RedactedCHI>().First();
var revertCmd = new ExecuteCommandRevertRedactedCHI(new ThrowImmediatelyActivator(RepositoryLocator), rCHI);
Assert.DoesNotThrow(() => revertCmd.Execute());
Assert.DoesNotThrow(() => revertCmd.Execute());
Assert.That(redactedChisCount, Is.EqualTo(CatalogueRepository.GetAllObjects<RedactedCHI>().Length + 1));
dt = new DataTable();
using (var con = tbl.Database.Server.GetConnection())
{
using (var findCmd = tbl.Database.Server.GetCommand($"select * from {tbl.GetRuntimeName()} where SampleType = 'R1111111111'", con))
{
using var da = tbl.Database.Server.GetDataAdapter(findCmd);
da.Fill(dt);
}
}
Assert.That(dt.Rows.Count, Is.EqualTo(1));
dt.Dispose();

Check warning

Code scanning / CodeQL

Dispose may not be called if an exception is thrown during execution Warning

Dispose missed if exception is thrown by
call to method GetConnection
.
Dispose missed if exception is thrown by
call to method GetCommand
.
Dispose missed if exception is thrown by
call to method GetRuntimeName
.
Dispose missed if exception is thrown by
call to method GetDataAdapter
.
Dispose missed if exception is thrown by
call to method Fill
.
Dispose missed if exception is thrown by
call to method That
.
Dispose missed if exception is thrown by
call to method EqualTo
.

}
}
Loading