Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicLocationConfigurationDatabase/HydraulicLocationConfigurationDatabaseReaderTest.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r00cd167e5b3fe6e817e063ab654459c90e550aea --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicLocationConfigurationDatabase/HydraulicLocationConfigurationDatabaseReaderTest.cs (.../HydraulicLocationConfigurationDatabaseReaderTest.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicLocationConfigurationDatabase/HydraulicLocationConfigurationDatabaseReaderTest.cs (.../HydraulicLocationConfigurationDatabaseReaderTest.cs) (revision 00cd167e5b3fe6e817e063ab654459c90e550aea) @@ -153,100 +153,5 @@ Assert.IsInstanceOf(exception.InnerException); } } - - [Test] - [TestCase(1000, true)] - [TestCase(11, false)] - public void GetCanUsePreprocessorByTrackId_ValidFile_ExpectedValues(long trackId, bool expectedUsePreprocessor) - { - // Setup - string dbFile = Path.Combine(testDataPath, "complete.sqlite"); - - using (var hydraulicBoundaryDatabaseReader = new HydraulicLocationConfigurationDatabaseReader(dbFile)) - { - // Call - bool usePreprocessor = hydraulicBoundaryDatabaseReader.GetCanUsePreprocessorByTrackId(trackId); - - // Assert - Assert.AreEqual(expectedUsePreprocessor, usePreprocessor); - } - } - - [Test] - public void GetCanUsePreprocessorByTrackId_ValidFileWithoutUsePreprocessorColumn_ReturnFalse() - { - // Setup - string dbFile = Path.Combine(testDataPath, "noUsePreprocessorColumn.sqlite"); - const int trackId = 1000; - - using (var hydraulicBoundaryDatabaseReader = new HydraulicLocationConfigurationDatabaseReader(dbFile)) - { - // Call - bool usePreprocessor = hydraulicBoundaryDatabaseReader.GetCanUsePreprocessorByTrackId(trackId); - - // Assert - Assert.IsFalse(usePreprocessor); - } - } - - [Test] - public void GetCanUsePreprocessorByTrackId_UnknownRegionIdForTrackId_ThrowsCriticalFileReadException() - { - // Setup - string dbFile = Path.Combine(testDataPath, "complete.sqlite"); - const int trackId = 1; - - using (var hydraulicBoundaryDatabaseReader = new HydraulicLocationConfigurationDatabaseReader(dbFile)) - { - // Call - TestDelegate test = () => hydraulicBoundaryDatabaseReader.GetCanUsePreprocessorByTrackId(trackId); - - // Assert - string expectedMessage = new FileReaderErrorMessageBuilder(dbFile).Build("Het bevragen van de database is mislukt."); - var exception = Assert.Throws(test); - Assert.AreEqual(expectedMessage, exception.Message); - Assert.IsNull(exception.InnerException); - } - } - - [Test] - public void GetCanUsePreprocessorByTrackId_EmptyFile_ThrowsCriticalFileReadException() - { - // Setup - string dbFile = Path.Combine(testDataPath, "empty.sqlite"); - const int trackId = 1; - - using (var hydraulicBoundaryDatabaseReader = new HydraulicLocationConfigurationDatabaseReader(dbFile)) - { - // Call - TestDelegate test = () => hydraulicBoundaryDatabaseReader.GetCanUsePreprocessorByTrackId(trackId); - - // Assert - string expectedMessage = new FileReaderErrorMessageBuilder(dbFile).Build("Het bevragen van de database is mislukt."); - var exception = Assert.Throws(test); - Assert.AreEqual(expectedMessage, exception.Message); - Assert.IsInstanceOf(exception.InnerException); - } - } - - [Test] - public void GetCanUsePreprocessorByTrackId_InvalidColumns_ThrowsLineParseException() - { - // Setup - string dbFile = Path.Combine(testDataPath, "corruptschema.sqlite"); - const int trackId = 1000; - - using (var hydraulicBoundaryDatabaseReader = new HydraulicLocationConfigurationDatabaseReader(dbFile)) - { - // Call - TestDelegate test = () => hydraulicBoundaryDatabaseReader.GetCanUsePreprocessorByTrackId(trackId); - - // Assert - string expectedMessage = new FileReaderErrorMessageBuilder(dbFile).Build("Kritieke fout opgetreden bij het uitlezen van waardes uit kolommen in de database."); - var exception = Assert.Throws(test); - Assert.AreEqual(expectedMessage, exception.Message); - Assert.IsInstanceOf(exception.InnerException); - } - } } } \ No newline at end of file