Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs
===================================================================
diff -u -rfea3ed82dfb6dfcad535eef16efcbaa9c01564ed -rce871f8d394d4539208c9ef68372dd9d64ae1941
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs (.../GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs) (revision fea3ed82dfb6dfcad535eef16efcbaa9c01564ed)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs (.../GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs) (revision ce871f8d394d4539208c9ef68372dd9d64ae1941)
@@ -93,19 +93,17 @@
CreateDikeProfile()
};
- using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(new Form(), dikeProfiles))
- {
- var selectionView = (DataGridView) new ControlTester("DikeProfileDataGrid", dialog).TheObject;
+ var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(new Form(), dikeProfiles);
+ var selectionView = (DataGridView) new ControlTester("DikeProfileDataGrid", dialog).TheObject;
- dialog.Show();
- selectionView.Rows[0].Cells[0].Value = true;
+ dialog.Show();
+ selectionView.Rows[0].Cells[0].Value = true;
- // When
- dialog.Close();
+ // When
+ dialog.Close();
- // Then
- Assert.IsEmpty(dialog.SelectedDikeProfiles);
- }
+ // Then
+ Assert.IsEmpty(dialog.SelectedDikeProfiles);
}
[Test]
@@ -119,20 +117,18 @@
CreateDikeProfile()
};
- using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(new Form(), dikeProfiles))
- {
- var selectionView = (DataGridView) new ControlTester("DikeProfileDataGrid", dialog).TheObject;
+ var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(new Form(), dikeProfiles);
+ var selectionView = (DataGridView) new ControlTester("DikeProfileDataGrid", dialog).TheObject;
- dialog.Show();
- selectionView.Rows[0].Cells[0].Value = true;
+ dialog.Show();
+ selectionView.Rows[0].Cells[0].Value = true;
- // When
- var cancelButton = new ButtonTester("CustomCancelButton", dialog);
- cancelButton.Click();
+ // When
+ var cancelButton = new ButtonTester("CustomCancelButton", dialog);
+ cancelButton.Click();
- // Then
- Assert.IsEmpty(dialog.SelectedDikeProfiles);
- }
+ // Then
+ Assert.IsEmpty(dialog.SelectedDikeProfiles);
}
[Test]
@@ -146,24 +142,22 @@
CreateDikeProfile()
};
- using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(new Form(), dikeProfiles))
- {
- var selectionView = (DataGridView) new ControlTester("DikeProfileDataGrid", dialog).TheObject;
+ var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(new Form(), dikeProfiles);
+ var selectionView = (DataGridView) new ControlTester("DikeProfileDataGrid", dialog).TheObject;
- dialog.Show();
- selectionView.Rows[0].Cells[0].Value = true;
+ dialog.Show();
+ selectionView.Rows[0].Cells[0].Value = true;
- // When
- var okButton = new ButtonTester("OkButton", dialog);
- okButton.Click();
+ // When
+ var okButton = new ButtonTester("OkButton", dialog);
+ okButton.Click();
- // Then
- var result = dialog.SelectedDikeProfiles;
- CollectionAssert.AreEqual(new[]
- {
- selectedDikeProfile
- }, result);
- }
+ // Then
+ var result = dialog.SelectedDikeProfiles;
+ CollectionAssert.AreEqual(new[]
+ {
+ selectedDikeProfile
+ }, result);
}
private DikeProfile CreateDikeProfile()
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ExceedanceProbabilityCalculationParser.cs
===================================================================
diff -u -r28eca7c7266b51b09790d1dcaa23808283457c46 -rce871f8d394d4539208c9ef68372dd9d64ae1941
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ExceedanceProbabilityCalculationParser.cs (.../ExceedanceProbabilityCalculationParser.cs) (revision 28eca7c7266b51b09790d1dcaa23808283457c46)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Calculation/Parsers/ExceedanceProbabilityCalculationParser.cs (.../ExceedanceProbabilityCalculationParser.cs) (revision ce871f8d394d4539208c9ef68372dd9d64ae1941)
@@ -79,21 +79,19 @@
private static ExceedanceProbabilityCalculationOutput DoParse(string outputFilePath, int sectionId)
{
- using (var sqLiteConnection = CreateConnection(outputFilePath))
- {
- sqLiteConnection.Open();
+ var sqLiteConnection = CreateConnection(outputFilePath);
+ sqLiteConnection.Open();
- int betaId;
- var exceedanceProbabilityCalculationOutput = ReadExceedanceProbabilityCalculationOutput(sectionId, sqLiteConnection, out betaId);
+ int betaId;
+ var exceedanceProbabilityCalculationOutput = ReadExceedanceProbabilityCalculationOutput(sectionId, sqLiteConnection, out betaId);
- foreach (var alpha in ReadExceedanceProbabilityCalculationAlphaOutput(sectionId, betaId, sqLiteConnection))
- {
- exceedanceProbabilityCalculationOutput.Alphas.Add(alpha);
- }
-
- sqLiteConnection.Close();
- return exceedanceProbabilityCalculationOutput;
+ foreach (var alpha in ReadExceedanceProbabilityCalculationAlphaOutput(sectionId, betaId, sqLiteConnection))
+ {
+ exceedanceProbabilityCalculationOutput.Alphas.Add(alpha);
}
+
+ sqLiteConnection.Close();
+ return exceedanceProbabilityCalculationOutput;
}
private static SQLiteDataReader CreateDataReader(SQLiteConnection connection, string queryString, params SQLiteParameter[] parameters)
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/FailureMechanismContributionView.cs
===================================================================
diff -u -rd25748ccc2d23450df61c1d49bc70274b22303bc -rce871f8d394d4539208c9ef68372dd9d64ae1941
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/FailureMechanismContributionView.cs (.../FailureMechanismContributionView.cs) (revision d25748ccc2d23450df61c1d49bc70274b22303bc)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/FailureMechanismContributionView.cs (.../FailureMechanismContributionView.cs) (revision ce871f8d394d4539208c9ef68372dd9d64ae1941)
@@ -187,6 +187,9 @@
{
failureMechanism.Detach(isFailureMechanismRelevantObserver);
failureMechanism.Detach(closeViewsForIrrelevantFailureMechanismObserver);
+
+ isFailureMechanismRelevantObserver.Dispose();
+ closeViewsForIrrelevantFailureMechanismObserver.Dispose();
}
}
}
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Exceptions/PipingSoilProfileReadException.cs
===================================================================
diff -u -rf62076c7d8b6a65856fbab6a1b34b4234aa319e5 -rce871f8d394d4539208c9ef68372dd9d64ae1941
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/Exceptions/PipingSoilProfileReadException.cs (.../PipingSoilProfileReadException.cs) (revision f62076c7d8b6a65856fbab6a1b34b4234aa319e5)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Exceptions/PipingSoilProfileReadException.cs (.../PipingSoilProfileReadException.cs) (revision ce871f8d394d4539208c9ef68372dd9d64ae1941)
@@ -29,9 +29,9 @@
/// Exception thrown when something went wrong while reading in .
///
[Serializable]
- public class PipingSoilProfileReadException : Exception
+ public sealed class PipingSoilProfileReadException : Exception
{
- private readonly string ProfileNameKey = "ProfileName";
+ private const string profileNameKey = "ProfileName";
///
/// Initializes a new instance of the class.
@@ -75,11 +75,11 @@
{
get
{
- return (string)Data[ProfileNameKey];
+ return (string)Data[profileNameKey];
}
private set
{
- Data[ProfileNameKey] = value;
+ Data[profileNameKey] = value;
}
}
}
Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/PipingSoilProfileReader.cs
===================================================================
diff -u -rce31448a066c084f755439f3e7d453bfb042b291 -rce871f8d394d4539208c9ef68372dd9d64ae1941
--- Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/PipingSoilProfileReader.cs (.../PipingSoilProfileReader.cs) (revision ce31448a066c084f755439f3e7d453bfb042b291)
+++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/PipingSoilProfileReader.cs (.../PipingSoilProfileReader.cs) (revision ce871f8d394d4539208c9ef68372dd9d64ae1941)
@@ -211,7 +211,10 @@
}
catch (SQLiteException e)
{
- Dispose();
+ if (dataReader != null)
+ {
+ dataReader.Dispose();
+ }
var message = new FileReaderErrorMessageBuilder(Path).Build(Resources.Error_SoilProfile_read_from_database);
throw new CriticalFileReadException(message, e);
}
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PipingSurfaceLineSelectionDialogTest.cs
===================================================================
diff -u -rfea3ed82dfb6dfcad535eef16efcbaa9c01564ed -rce871f8d394d4539208c9ef68372dd9d64ae1941
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PipingSurfaceLineSelectionDialogTest.cs (.../PipingSurfaceLineSelectionDialogTest.cs) (revision fea3ed82dfb6dfcad535eef16efcbaa9c01564ed)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PipingSurfaceLineSelectionDialogTest.cs (.../PipingSurfaceLineSelectionDialogTest.cs) (revision ce871f8d394d4539208c9ef68372dd9d64ae1941)
@@ -93,20 +93,17 @@
new RingtoetsPipingSurfaceLine()
};
- using (var dialog = new PipingSurfaceLineSelectionDialog(new Form(), surfaceLines))
- {
+ var dialog = new PipingSurfaceLineSelectionDialog(new Form(), surfaceLines);
+ var selectionView = (DataGridView) new ControlTester("SurfaceLineDataGrid", dialog).TheObject;
- var selectionView = (DataGridView) new ControlTester("SurfaceLineDataGrid", dialog).TheObject;
+ dialog.Show();
+ selectionView.Rows[0].Cells[0].Value = true;
- dialog.Show();
- selectionView.Rows[0].Cells[0].Value = true;
+ // When
+ dialog.Close();
- // When
- dialog.Close();
-
- // Then
- Assert.IsEmpty(dialog.SelectedSurfaceLines);
- }
+ // Then
+ Assert.IsEmpty(dialog.SelectedSurfaceLines);
}
[Test]
@@ -120,20 +117,18 @@
new RingtoetsPipingSurfaceLine()
};
- using (var dialog = new PipingSurfaceLineSelectionDialog(new Form(), surfaceLines))
- {
- var selectionView = (DataGridView) new ControlTester("SurfaceLineDataGrid", dialog).TheObject;
+ var dialog = new PipingSurfaceLineSelectionDialog(new Form(), surfaceLines);
+ var selectionView = (DataGridView) new ControlTester("SurfaceLineDataGrid", dialog).TheObject;
- dialog.Show();
- selectionView.Rows[0].Cells[0].Value = true;
+ dialog.Show();
+ selectionView.Rows[0].Cells[0].Value = true;
- // When
- var cancelButton = new ButtonTester("CustomCancelButton", dialog);
- cancelButton.Click();
+ // When
+ var cancelButton = new ButtonTester("CustomCancelButton", dialog);
+ cancelButton.Click();
- // Then
- Assert.IsEmpty(dialog.SelectedSurfaceLines);
- }
+ // Then
+ Assert.IsEmpty(dialog.SelectedSurfaceLines);
}
[Test]
@@ -147,24 +142,22 @@
new RingtoetsPipingSurfaceLine()
};
- using (var dialog = new PipingSurfaceLineSelectionDialog(new Form(), surfaceLines))
- {
- var selectionView = (DataGridView) new ControlTester("SurfaceLineDataGrid", dialog).TheObject;
+ var dialog = new PipingSurfaceLineSelectionDialog(new Form(), surfaceLines);
+ var selectionView = (DataGridView) new ControlTester("SurfaceLineDataGrid", dialog).TheObject;
- dialog.Show();
- selectionView.Rows[0].Cells[0].Value = true;
+ dialog.Show();
+ selectionView.Rows[0].Cells[0].Value = true;
- // When
- var okButton = new ButtonTester("OkButton", dialog);
- okButton.Click();
+ // When
+ var okButton = new ButtonTester("OkButton", dialog);
+ okButton.Click();
- // Then
- var result = dialog.SelectedSurfaceLines;
- CollectionAssert.AreEqual(new[]
- {
- selectedSurfaceLine
- }, result);
- }
+ // Then
+ var result = dialog.SelectedSurfaceLines;
+ CollectionAssert.AreEqual(new[]
+ {
+ selectedSurfaceLine
+ }, result);
}
}
}
\ No newline at end of file