Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/PipingConfigurationReaderTest.cs =================================================================== diff -u -r87f2a9ca76ec0a77b2dcc6bf69c6d9d8a3b29168 -rf01130d610fadc513e82f78093100fdd55c4b173 --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/PipingConfigurationReaderTest.cs (.../PipingConfigurationReaderTest.cs) (revision 87f2a9ca76ec0a77b2dcc6bf69c6d9d8a3b29168) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/PipingConfigurationReaderTest.cs (.../PipingConfigurationReaderTest.cs) (revision f01130d610fadc513e82f78093100fdd55c4b173) @@ -228,7 +228,7 @@ public void Constructor_FileInUse_ThrowCriticalFileReadException() { // Setup - string filePath = Path.Combine(testDirectoryPath, "validEmptyRoot.xml"); + string filePath = Path.Combine(testDirectoryPath, "validConfigurationNesting.xml"); using (new FileStream(filePath, FileMode.Open)) { @@ -277,17 +277,19 @@ } [Test] - public void Read_ValidConfigurationWithEmptyRoot_ReturnEmptyReadPipingCalculationItemsCollection() + public void Constructor_FileInvalidBasedOnEmptyRoot_ThrowCriticalFileReadException() { // Setup - string filePath = Path.Combine(testDirectoryPath, "validEmptyRoot.xml"); - var pipingConfigurationReader = new PipingConfigurationReader(filePath); + string filePath = Path.Combine(testDirectoryPath, "invalidEmptyRoot.xml"); // Call - IEnumerable readPipingCalculationItems = pipingConfigurationReader.Read(); + TestDelegate call = () => new PipingConfigurationReader(filePath); // Assert - CollectionAssert.IsEmpty(readPipingCalculationItems); + string expectedMessage = $"Fout bij het lezen van bestand '{filePath}': het XML-document dat de configuratie" + + " voor de berekeningen beschrijft bevat geen berekeningselementen."; + var exception = Assert.Throws(call); + Assert.AreEqual(expectedMessage, exception.Message); } [Test]