Index: Core/Components/test/Core.Components.Gis.IO.Test/Readers/PointShapeFileReaderTest.cs =================================================================== diff -u -r2adc3404adf005edabae77ae492f65d11367a998 -r6928d01beb183acca2937ed5835e951e999be5cb --- Core/Components/test/Core.Components.Gis.IO.Test/Readers/PointShapeFileReaderTest.cs (.../PointShapeFileReaderTest.cs) (revision 2adc3404adf005edabae77ae492f65d11367a998) +++ Core/Components/test/Core.Components.Gis.IO.Test/Readers/PointShapeFileReaderTest.cs (.../PointShapeFileReaderTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -67,9 +67,8 @@ TestDelegate call = () => new PointShapeFileReader(nonPointShapeFile); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': kon geen punten vinden in dit bestand.", - nonPointShapeFile); - var message = Assert.Throws(call).Message; + string expectedMessage = $"Fout bij het lezen van bestand '{nonPointShapeFile}': kon geen punten vinden in dit bestand."; + string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -84,9 +83,8 @@ TestDelegate call = () => new PointShapeFileReader(nonExistingPointShapeFile); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand bestaat niet.", - nonExistingPointShapeFile); - var message = Assert.Throws(call).Message; + string expectedMessage = $"Fout bij het lezen van bestand '{nonExistingPointShapeFile}': het bestand bestaat niet."; + string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -101,9 +99,8 @@ TestDelegate call = () => new PointShapeFileReader(emptyPointShapeFile); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': kon geen punten vinden in dit bestand.", - emptyPointShapeFile); - var message = Assert.Throws(call).Message; + string expectedMessage = $"Fout bij het lezen van bestand '{emptyPointShapeFile}': kon geen punten vinden in dit bestand."; + string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } @@ -118,27 +115,27 @@ TestDelegate call = () => new PointShapeFileReader(corruptPointShapeFile); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie.", - corruptPointShapeFile); - var message = Assert.Throws(call).Message; + string expectedMessage = $"Fout bij het lezen van bestand '{corruptPointShapeFile}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; + string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } [Test] public void ParameteredConstructor_ShapeFileIsInUse_ThrowsCriticalFileReadException() { // Setup - string testFilePath = TestHelper.GetTestDataPath(TestDataPath.Core.Components.Gis.IO, "Single_Point_with_ID.shp"); + string path = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); - using (File.Open(testFilePath, FileMode.Open, FileAccess.ReadWrite)) + using (var fileDisposeHelper = new FileDisposeHelper(path)) { + fileDisposeHelper.LockFiles(); + // Call - TestDelegate call = () => new PointShapeFileReader(testFilePath); + TestDelegate call = () => new PointShapeFileReader(path); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie.", - testFilePath); - CriticalFileReadException exception = Assert.Throws(call); + string expectedMessage = $"Fout bij het lezen van bestand '{path}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; + var exception = Assert.Throws(call); Assert.AreEqual(expectedMessage, exception.Message); Assert.IsInstanceOf(exception.InnerException); } @@ -153,7 +150,7 @@ using (var reader = new PointShapeFileReader(shapeWithOneLine)) { // Call - var count = reader.GetNumberOfFeatures(); + int count = reader.GetNumberOfFeatures(); // Assert Assert.AreEqual(0, count); @@ -169,7 +166,7 @@ using (var reader = new PointShapeFileReader(shapeWithOnePoint)) { // Call - var count = reader.GetNumberOfFeatures(); + int count = reader.GetNumberOfFeatures(); // Assert Assert.AreEqual(1, count); @@ -186,7 +183,7 @@ using (var reader = new PointShapeFileReader(shapeWithMultiplePoints)) { // Call - var count = reader.GetNumberOfFeatures(); + int count = reader.GetNumberOfFeatures(); // Assert Assert.AreEqual(6, count); @@ -204,7 +201,7 @@ using (var reader = new PointShapeFileReader(shapeWithOnePoint)) { // Call - MapPointData pointData = (MapPointData) reader.ReadFeature(name); + var pointData = (MapPointData) reader.ReadFeature(name); // Assert Assert.AreEqual(name, pointData.Name); @@ -223,7 +220,7 @@ using (var reader = new PointShapeFileReader(shapeWithOnePoint)) { // Call - MapPointData pointData = (MapPointData) reader.ReadFeature(name); + var pointData = (MapPointData) reader.ReadFeature(name); // Assert Assert.AreEqual("Punten", pointData.Name); @@ -239,7 +236,7 @@ using (var reader = new PointShapeFileReader(shapeWithOnePoint)) { // Call - MapPointData pointData = reader.ReadFeature() as MapPointData; + var pointData = reader.ReadFeature() as MapPointData; // Assert Assert.IsNotNull(pointData); @@ -270,12 +267,12 @@ Assert.AreEqual(6, reader.GetNumberOfFeatures()); // Call - MapPointData points1 = (MapPointData) reader.ReadFeature(); - MapPointData points2 = (MapPointData) reader.ReadFeature(); - MapPointData points3 = (MapPointData) reader.ReadFeature(); - MapPointData points4 = (MapPointData) reader.ReadFeature(); - MapPointData points5 = (MapPointData) reader.ReadFeature(); - MapPointData points6 = (MapPointData) reader.ReadFeature(); + var points1 = (MapPointData) reader.ReadFeature(); + var points2 = (MapPointData) reader.ReadFeature(); + var points3 = (MapPointData) reader.ReadFeature(); + var points4 = (MapPointData) reader.ReadFeature(); + var points5 = (MapPointData) reader.ReadFeature(); + var points6 = (MapPointData) reader.ReadFeature(); // Assert @@ -406,7 +403,7 @@ using (var reader = new PointShapeFileReader(shapeWithOnePoint)) { // Call - MapPointData pointData = (MapPointData) reader.ReadShapeFile(name); + var pointData = (MapPointData) reader.ReadShapeFile(name); // Assert Assert.AreEqual(name, pointData.Name); @@ -425,7 +422,7 @@ using (var reader = new PointShapeFileReader(shapeWithOnePoint)) { // Call - MapPointData pointData = (MapPointData) reader.ReadShapeFile(name); + var pointData = (MapPointData) reader.ReadShapeFile(name); // Assert Assert.AreEqual("Punten", pointData.Name); @@ -444,7 +441,7 @@ Assert.AreEqual(6, reader.GetNumberOfFeatures()); // Call - MapPointData points = (MapPointData) reader.ReadShapeFile(); + var points = (MapPointData) reader.ReadShapeFile(); // Assert var features = points.Features.ToArray(); @@ -578,13 +575,13 @@ fileName); using (var reader = new PointShapeFileReader(filePath)) { - for (int i = 0; i < reader.GetNumberOfFeatures(); i++) + for (var i = 0; i < reader.GetNumberOfFeatures(); i++) { reader.ReadFeature(); } // Call - MapPointData feature = reader.ReadFeature() as MapPointData; + var feature = reader.ReadFeature() as MapPointData; // Assert Assert.IsNull(feature); Index: Core/Components/test/Core.Components.Gis.IO.Test/Readers/PolygonShapeFileReaderTest.cs =================================================================== diff -u -r6800d7c838fe4f3a9c69af6bc6ea1b31c326f530 -r6928d01beb183acca2937ed5835e951e999be5cb --- Core/Components/test/Core.Components.Gis.IO.Test/Readers/PolygonShapeFileReaderTest.cs (.../PolygonShapeFileReaderTest.cs) (revision 6800d7c838fe4f3a9c69af6bc6ea1b31c326f530) +++ Core/Components/test/Core.Components.Gis.IO.Test/Readers/PolygonShapeFileReaderTest.cs (.../PolygonShapeFileReaderTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -72,27 +72,27 @@ TestDelegate call = () => new PolygonShapeFileReader(nonPolygonShapeFile); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': kon geen polygonen vinden in dit bestand.", - nonPolygonShapeFile); - var message = Assert.Throws(call).Message; + string expectedMessage = $"Fout bij het lezen van bestand '{nonPolygonShapeFile}': kon geen polygonen vinden in dit bestand."; + string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } [Test] public void ParameteredConstructor_ShapeFileIsInUse_ThrowsCriticalFileReadException() { // Setup - string testFilePath = TestHelper.GetTestDataPath(TestDataPath.Core.Components.Gis.IO, "Single_Multi-Polygon_with_ID.shp"); + string path = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); - using (File.Open(testFilePath, FileMode.Open, FileAccess.ReadWrite)) + using (var fileDisposeHelper = new FileDisposeHelper(path)) { + fileDisposeHelper.LockFiles(); + // Call - TestDelegate call = () => new PolygonShapeFileReader(testFilePath); + TestDelegate call = () => new PolygonShapeFileReader(path); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie.", - testFilePath); - CriticalFileReadException exception = Assert.Throws(call); + string expectedMessage = $"Fout bij het lezen van bestand '{path}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; + var exception = Assert.Throws(call); Assert.AreEqual(expectedMessage, exception.Message); Assert.IsInstanceOf(exception.InnerException); } @@ -107,7 +107,7 @@ using (var reader = new PolygonShapeFileReader(shapeWithOnePolygon)) { // Call - var count = reader.GetNumberOfFeatures(); + int count = reader.GetNumberOfFeatures(); // Assert Assert.AreEqual(0, count); @@ -123,7 +123,7 @@ using (var reader = new PolygonShapeFileReader(shapeWithOnePolygon)) { // Call - var count = reader.GetNumberOfFeatures(); + int count = reader.GetNumberOfFeatures(); // Assert Assert.AreEqual(1, count); @@ -139,7 +139,7 @@ using (var reader = new PolygonShapeFileReader(shapeWithOnePolygonWithHoles)) { // Call - var count = reader.GetNumberOfFeatures(); + int count = reader.GetNumberOfFeatures(); // Assert Assert.AreEqual(1, count); @@ -156,7 +156,7 @@ using (var reader = new PolygonShapeFileReader(shapeWithMultiplePolygons)) { // Call - var count = reader.GetNumberOfFeatures(); + int count = reader.GetNumberOfFeatures(); // Assert Assert.AreEqual(4, count); @@ -174,7 +174,7 @@ using (var reader = new PolygonShapeFileReader(shapeWithOnePolygon)) { // Call - MapPolygonData polygon = (MapPolygonData) reader.ReadFeature(name); + var polygon = (MapPolygonData) reader.ReadFeature(name); // Assert Assert.AreEqual(name, polygon.Name); @@ -193,7 +193,7 @@ using (var reader = new PolygonShapeFileReader(shapeWithOnePolygon)) { // Call - MapPolygonData polygon = (MapPolygonData) reader.ReadFeature(name); + var polygon = (MapPolygonData) reader.ReadFeature(name); // Assert Assert.AreEqual("Polygoon", polygon.Name); @@ -209,7 +209,7 @@ using (var reader = new PolygonShapeFileReader(shapeWithOnePolygon)) { // Call - MapPolygonData polygon = (MapPolygonData) reader.ReadFeature(); + var polygon = (MapPolygonData) reader.ReadFeature(); // Assert Assert.IsNotNull(polygon); @@ -238,7 +238,7 @@ using (var reader = new PolygonShapeFileReader(shapeWithOnePolygonWithHoles)) { // Call - MapPolygonData polygon = (MapPolygonData) reader.ReadFeature(); + var polygon = (MapPolygonData) reader.ReadFeature(); // Assert Assert.IsNotNull(polygon); @@ -301,7 +301,7 @@ using (var reader = new PolygonShapeFileReader(shape)) { // Call - MapPolygonData polygon = (MapPolygonData) reader.ReadFeature(); + var polygon = (MapPolygonData) reader.ReadFeature(); // Assert Assert.IsNotNull(polygon); @@ -333,10 +333,10 @@ Assert.AreEqual(4, reader.GetNumberOfFeatures()); // Call - MapPolygonData polygons1 = (MapPolygonData) reader.ReadFeature(); - MapPolygonData polygons2 = (MapPolygonData) reader.ReadFeature(); - MapPolygonData polygons3 = (MapPolygonData) reader.ReadFeature(); - MapPolygonData polygons4 = (MapPolygonData) reader.ReadFeature(); + var polygons1 = (MapPolygonData) reader.ReadFeature(); + var polygons2 = (MapPolygonData) reader.ReadFeature(); + var polygons3 = (MapPolygonData) reader.ReadFeature(); + var polygons4 = (MapPolygonData) reader.ReadFeature(); // Assert @@ -427,7 +427,7 @@ using (var reader = new PolygonShapeFileReader(shapeWithOnePolygon)) { // Call - MapPolygonData polygon = (MapPolygonData) reader.ReadShapeFile(); + var polygon = (MapPolygonData) reader.ReadShapeFile(); // Assert Assert.IsNotNull(polygon); @@ -461,7 +461,7 @@ using (var reader = new PolygonShapeFileReader(shape)) { // Call - MapPolygonData polygon = (MapPolygonData) reader.ReadShapeFile(); + var polygon = (MapPolygonData) reader.ReadShapeFile(); // Assert Assert.IsNotNull(polygon); @@ -496,7 +496,7 @@ using (var reader = new PolygonShapeFileReader(shapeWithOnePolygon)) { // Call - MapPolygonData polygon = (MapPolygonData) reader.ReadShapeFile(name); + var polygon = (MapPolygonData) reader.ReadShapeFile(name); // Assert Assert.AreEqual(name, polygon.Name); @@ -515,7 +515,7 @@ using (var reader = new PolygonShapeFileReader(shapeWithOnePolygon)) { // Call - MapPolygonData polygon = (MapPolygonData) reader.ReadShapeFile(name); + var polygon = (MapPolygonData) reader.ReadShapeFile(name); // Assert Assert.AreEqual("Polygoon", polygon.Name); @@ -534,7 +534,7 @@ Assert.AreEqual(4, reader.GetNumberOfFeatures()); // Call - MapPolygonData polygons = (MapPolygonData) reader.ReadShapeFile(); + var polygons = (MapPolygonData) reader.ReadShapeFile(); // Assert MapFeature[] features = polygons.Features.ToArray(); @@ -631,13 +631,13 @@ fileName); using (var reader = new PolygonShapeFileReader(filePath)) { - for (int i = 0; i < reader.GetNumberOfFeatures(); i++) + for (var i = 0; i < reader.GetNumberOfFeatures(); i++) { reader.ReadFeature(); } // Call - MapPolygonData polygon = reader.ReadFeature() as MapPolygonData; + var polygon = reader.ReadFeature() as MapPolygonData; // Assert Assert.IsNull(polygon); Index: Core/Components/test/Core.Components.Gis.IO.Test/Readers/PolylineShapeFileReaderTest.cs =================================================================== diff -u -r6800d7c838fe4f3a9c69af6bc6ea1b31c326f530 -r6928d01beb183acca2937ed5835e951e999be5cb --- Core/Components/test/Core.Components.Gis.IO.Test/Readers/PolylineShapeFileReaderTest.cs (.../PolylineShapeFileReaderTest.cs) (revision 6800d7c838fe4f3a9c69af6bc6ea1b31c326f530) +++ Core/Components/test/Core.Components.Gis.IO.Test/Readers/PolylineShapeFileReaderTest.cs (.../PolylineShapeFileReaderTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -66,27 +66,27 @@ TestDelegate call = () => new PolylineShapeFileReader(nonLineShapeFile); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': kon geen lijnen vinden in dit bestand.", - nonLineShapeFile); - var message = Assert.Throws(call).Message; + string expectedMessage = $"Fout bij het lezen van bestand '{nonLineShapeFile}': kon geen lijnen vinden in dit bestand."; + string message = Assert.Throws(call).Message; Assert.AreEqual(expectedMessage, message); } [Test] public void ParameteredConstructor_ShapeFileIsInUse_ThrowsCriticalFileReadException() { // Setup - string testFilePath = TestHelper.GetTestDataPath(TestDataPath.Core.Components.Gis.IO, "traject_10-1.shp"); + string path = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); - using (File.Open(testFilePath, FileMode.Open, FileAccess.ReadWrite)) + using (var fileDisposeHelper = new FileDisposeHelper(path)) { + fileDisposeHelper.LockFiles(); + // Call - TestDelegate call = () => new PolylineShapeFileReader(testFilePath); + TestDelegate call = () => new PolylineShapeFileReader(path); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie.", - testFilePath); - CriticalFileReadException exception = Assert.Throws(call); + string expectedMessage = $"Fout bij het lezen van bestand '{path}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; + var exception = Assert.Throws(call); Assert.AreEqual(expectedMessage, exception.Message); Assert.IsInstanceOf(exception.InnerException); } @@ -101,7 +101,7 @@ using (var reader = new PolylineShapeFileReader(shapeWithOneLine)) { // Call - var count = reader.GetNumberOfFeatures(); + int count = reader.GetNumberOfFeatures(); // Assert Assert.AreEqual(0, count); @@ -117,7 +117,7 @@ using (var reader = new PolylineShapeFileReader(shapeWithOneLine)) { // Call - var count = reader.GetNumberOfFeatures(); + int count = reader.GetNumberOfFeatures(); // Assert Assert.AreEqual(1, count); @@ -134,7 +134,7 @@ using (var reader = new PolylineShapeFileReader(shapeWithMultipleLines)) { // Call - var count = reader.GetNumberOfFeatures(); + int count = reader.GetNumberOfFeatures(); // Assert Assert.AreEqual(4, count); @@ -152,7 +152,7 @@ using (var reader = new PolylineShapeFileReader(shapeWithOneLine)) { // Call - MapLineData line = (MapLineData) reader.ReadFeature(name); + var line = (MapLineData) reader.ReadFeature(name); // Assert Assert.AreEqual(name, line.Name); @@ -171,7 +171,7 @@ using (var reader = new PolylineShapeFileReader(shapeWithOneLine)) { // Call - MapLineData line = (MapLineData) reader.ReadFeature(name); + var line = (MapLineData) reader.ReadFeature(name); // Assert Assert.AreEqual("Lijn", line.Name); @@ -187,7 +187,7 @@ using (var reader = new PolylineShapeFileReader(shapeWithOneLine)) { // Call - MapLineData line = (MapLineData) reader.ReadFeature(); + var line = (MapLineData) reader.ReadFeature(); // Assert Assert.IsNotNull(line); @@ -228,10 +228,10 @@ Assert.AreEqual(4, reader.GetNumberOfFeatures()); // Call - MapLineData line1 = (MapLineData) reader.ReadFeature(); - MapLineData line2 = (MapLineData) reader.ReadFeature(); - MapLineData line3 = (MapLineData) reader.ReadFeature(); - MapLineData line4 = (MapLineData) reader.ReadFeature(); + var line1 = (MapLineData) reader.ReadFeature(); + var line2 = (MapLineData) reader.ReadFeature(); + var line3 = (MapLineData) reader.ReadFeature(); + var line4 = (MapLineData) reader.ReadFeature(); // Assert @@ -332,7 +332,7 @@ using (var reader = new PolylineShapeFileReader(shapeWithOneLine)) { // Call - MapLineData line = (MapLineData) reader.ReadShapeFile(name); + var line = (MapLineData) reader.ReadShapeFile(name); // Assert Assert.AreEqual(name, line.Name); @@ -351,7 +351,7 @@ using (var reader = new PolylineShapeFileReader(shapeWithOneLine)) { // Call - MapLineData line = (MapLineData) reader.ReadShapeFile(name); + var line = (MapLineData) reader.ReadShapeFile(name); // Assert Assert.AreEqual("Lijn", line.Name); @@ -367,7 +367,7 @@ using (var reader = new PolylineShapeFileReader(shapeWithOneLine)) { // Call - MapLineData line = (MapLineData) reader.ReadShapeFile(); + var line = (MapLineData) reader.ReadShapeFile(); // Assert Assert.IsNotNull(line); @@ -409,7 +409,7 @@ Assert.AreEqual(4, reader.GetNumberOfFeatures()); // Call - MapLineData lines = (MapLineData) reader.ReadShapeFile(); + var lines = (MapLineData) reader.ReadShapeFile(); // Assert MapFeature[] features = lines.Features.ToArray(); @@ -502,13 +502,13 @@ shapeFileName); using (var reader = new PolylineShapeFileReader(linesShapefileFilePath)) { - for (int i = 0; i < reader.GetNumberOfFeatures(); i++) + for (var i = 0; i < reader.GetNumberOfFeatures(); i++) { reader.ReadFeature(); } // Call - MapLineData line = reader.ReadFeature() as MapLineData; + var line = reader.ReadFeature() as MapLineData; // Assert Assert.IsNull(line); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/ProfileLocationReaderTest.cs =================================================================== diff -u -r7b85dbce8bcc39e824c367468892764778527ce4 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/ProfileLocationReaderTest.cs (.../ProfileLocationReaderTest.cs) (revision 7b85dbce8bcc39e824c367468892764778527ce4) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/DikeProfiles/ProfileLocationReaderTest.cs (.../ProfileLocationReaderTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -163,17 +163,17 @@ public void Constructor_FileInUse_ThrowCriticalFileReadException() { // Setup - string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, - Path.Combine("DikeProfiles", "Voorlanden 12-2.shp")); + string path = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); - using (new FileStream(validFilePath, FileMode.Open)) + using (var fileDisposeHelper = new FileDisposeHelper(path)) { + fileDisposeHelper.LockFiles(); + // Call - TestDelegate call = () => new ProfileLocationReader(validFilePath); + TestDelegate call = () => new ProfileLocationReader(path); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie.", - validFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{path}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; var exception = Assert.Throws(call); Assert.AreEqual(expectedMessage, exception.Message); Assert.IsInstanceOf(exception.InnerException); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FailureMechanismSectionReaderTest.cs =================================================================== diff -u -r7b85dbce8bcc39e824c367468892764778527ce4 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FailureMechanismSectionReaderTest.cs (.../FailureMechanismSectionReaderTest.cs) (revision 7b85dbce8bcc39e824c367468892764778527ce4) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FailureMechanismSectionReaderTest.cs (.../FailureMechanismSectionReaderTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -321,18 +321,17 @@ public void ReadFailureMechanismSection_FileInUse_ThrowCriticalFileReadException() { // Setup - string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, - Path.Combine("FailureMechanismSections", "traject_227_vakken.shp")); + string path = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); - using (new FileStream(validFilePath, FileMode.Open)) + using (var fileDisposeHelper = new FileDisposeHelper(path)) { + fileDisposeHelper.LockFiles(); + // Call - TestDelegate call = () => new FailureMechanismSectionReader(validFilePath); + TestDelegate call = () => new FailureMechanismSectionReader(path); // Assert - var expectedMessage = string.Format( - "Fout bij het lezen van bestand '{0}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie.", - validFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{path}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; var exception = Assert.Throws(call); Assert.AreEqual(expectedMessage, exception.Message); Assert.IsInstanceOf(exception.InnerException); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineReaderTest.cs =================================================================== diff -u -r7b85dbce8bcc39e824c367468892764778527ce4 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineReaderTest.cs (.../ReferenceLineReaderTest.cs) (revision 7b85dbce8bcc39e824c367468892764778527ce4) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineReaderTest.cs (.../ReferenceLineReaderTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -198,18 +198,18 @@ public void ReadReferenceLine_FileInUse_ThrowCriticalFileReadException() { // Setup - var validReferenceLineShapeFile = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, - Path.Combine("ReferenceLine", "traject_10-2.shp")); var reader = new ReferenceLineReader(); + string path = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); - using (new FileStream(validReferenceLineShapeFile, FileMode.Open)) + using (var fileDisposeHelper = new FileDisposeHelper(path)) { + fileDisposeHelper.LockFiles(); + // Call - TestDelegate call = () => reader.ReadReferenceLine(validReferenceLineShapeFile); + TestDelegate call = () => reader.ReadReferenceLine(path); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie.", - validReferenceLineShapeFile); + string expectedMessage = $"Fout bij het lezen van bestand '{path}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; var exception = Assert.Throws(call); Assert.AreEqual(expectedMessage, exception.Message); Assert.IsInstanceOf(exception.InnerException); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructureLocationReaderTest.cs =================================================================== diff -u -r7b85dbce8bcc39e824c367468892764778527ce4 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructureLocationReaderTest.cs (.../StructureLocationReaderTest.cs) (revision 7b85dbce8bcc39e824c367468892764778527ce4) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Structures/StructureLocationReaderTest.cs (.../StructureLocationReaderTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -157,17 +157,17 @@ public void Constructor_FileInUse_ThrowCriticalFileReadException() { // Setup - string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, - Path.Combine("Structures", "CorrectFiles", "Kunstwerken.shp")); + string path = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); - using (new FileStream(validFilePath, FileMode.Open)) + using (var fileDisposeHelper = new FileDisposeHelper(path)) { + fileDisposeHelper.LockFiles(); + // Call - TestDelegate call = () => new StructureLocationReader(validFilePath); + TestDelegate call = () => new StructureLocationReader(path); // Assert - var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie.", - validFilePath); + string expectedMessage = $"Fout bij het lezen van bestand '{path}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; var exception = Assert.Throws(call); Assert.AreEqual(expectedMessage, exception.Message); Assert.IsInstanceOf(exception.InnerException); Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.IO.Test/DuneLocationsWriterTest.cs =================================================================== diff -u -rf43c22c9f5dc04d352988510303fcfe12d712be8 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.IO.Test/DuneLocationsWriterTest.cs (.../DuneLocationsWriterTest.cs) (revision f43c22c9f5dc04d352988510303fcfe12d712be8) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.IO.Test/DuneLocationsWriterTest.cs (.../DuneLocationsWriterTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -118,16 +118,18 @@ public void WriteDuneLocations_FileInUse_ThrowCriticalFileWriteException() { // Setup - string filePath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); - using (new FileDisposeHelper(filePath)) - using (new FileStream(filePath, FileMode.Open)) + string path = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); + + using (var fileDisposeHelper = new FileDisposeHelper(path)) { + fileDisposeHelper.LockFiles(); + // Call - TestDelegate call = () => DuneLocationsWriter.WriteDuneLocations(Enumerable.Empty(), filePath); + TestDelegate call = () => DuneLocationsWriter.WriteDuneLocations(Enumerable.Empty(), path); // Assert var exception = Assert.Throws(call); - Assert.AreEqual($"Er is een onverwachte fout opgetreden tijdens het schrijven van het bestand '{filePath}'.", exception.Message); + Assert.AreEqual($"Er is een onverwachte fout opgetreden tijdens het schrijven van het bestand '{path}'.", exception.Message); Assert.IsInstanceOf(exception.InnerException); } } @@ -136,12 +138,12 @@ public void WriteDuneLocations_ValidData_ValidFile() { // Setup - var locationNoOutput = CreateDuneLocationForExport(9, 9740, 1.9583e-4); + DuneLocation locationNoOutput = CreateDuneLocationForExport(9, 9740, 1.9583e-4); - var locationUncalculatedOutput = CreateDuneLocationForExport(10, 9770.1, 1.9583e-4); + DuneLocation locationUncalculatedOutput = CreateDuneLocationForExport(10, 9770.1, 1.9583e-4); locationUncalculatedOutput.Output = CreateDuneLocationOutputForExport(double.NaN, double.NaN, double.NaN); - var locationCalculatedOutput = CreateDuneLocationForExport(11, 9771.34, 1.337e-4); + DuneLocation locationCalculatedOutput = CreateDuneLocationForExport(11, 9771.34, 1.337e-4); locationCalculatedOutput.Output = CreateDuneLocationOutputForExport(5.89, 14.11, 8.53); DuneLocation[] duneLocations = Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Exporters/PipingConfigurationWriter.cs =================================================================== diff -u -rb7f9c9f43aac18c45ea1932f4559a29eda7fbe34 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Exporters/PipingConfigurationWriter.cs (.../PipingConfigurationWriter.cs) (revision b7f9c9f43aac18c45ea1932f4559a29eda7fbe34) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Exporters/PipingConfigurationWriter.cs (.../PipingConfigurationWriter.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -130,9 +130,9 @@ { writer.WriteElementString(PipingConfigurationSchemaIdentifiers.SurfaceLineElement, calculationInputParameters.SurfaceLine.Name); - writer.WriteElementString(PipingConfigurationSchemaIdentifiers.EntryPointElement, + writer.WriteElementString(PipingConfigurationSchemaIdentifiers.EntryPointLElement, ToStringInvariantCulture(calculationInputParameters.EntryPointL)); - writer.WriteElementString(PipingConfigurationSchemaIdentifiers.ExitPointElement, + writer.WriteElementString(PipingConfigurationSchemaIdentifiers.ExitPointLElement, ToStringInvariantCulture(calculationInputParameters.ExitPointL)); } Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.Designer.cs =================================================================== diff -u -rb7f9c9f43aac18c45ea1932f4559a29eda7fbe34 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision b7f9c9f43aac18c45ea1932f4559a29eda7fbe34) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -301,6 +301,27 @@ } /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8"?> + ///<!-- + ///Copyright (C) Stichting Deltares 2016. All rights reserved. + /// + ///This file is part of Ringtoets. + /// + ///Ringtoets is free software: you can redistribute it and/or modify + ///it under the terms of the GNU General Public License as published by + ///the Free Software Foundation, either version 3 of the License, or + ///(at your option) any later version. + /// + ///This program is distributed in the hope that it will be useful, + ///but WITHOUT ANY WARRANTY; without even the implied warranty [rest of string was truncated]";. + /// + public static string PipingConfigurationSchema { + get { + return ResourceManager.GetString("PipingConfigurationSchema", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Kritieke fout opgetreden bij het uitlezen van waardes uit kolommen in de database.. /// public static string PipingSoilProfileReader_Critical_Unexpected_value_on_column { @@ -686,5 +707,28 @@ return ResourceManager.GetString("StochasticSoilProfileDatabaseReader_StochasticSoilProfile_has_invalid_value", resourceCulture); } } + + /// + /// Looks up a localized string similar to <?xml version="1.0"?> + /// + ///<!-- + ///Copyright (C) Stichting Deltares 2016. All rights reserved. + /// + ///This file is part of Ringtoets. + /// + ///Ringtoets is free software: you can redistribute it and/or modify + ///it under the terms of the GNU General Public License as published by + ///the Free Software Foundation, either version 3 of the License, or + ///(at your option) any later version. + /// + ///This program is distributed in the hope that it will be useful, + ///but WITHOUT ANY WARRANTY; without even the implied warranty of + ///MERCHANTABI [rest of string was truncated]";. + /// + public static string XmlGeometrySchema { + get { + return ResourceManager.GetString("XmlGeometrySchema", resourceCulture); + } + } } } Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.resx =================================================================== diff -u -rb7f9c9f43aac18c45ea1932f4559a29eda7fbe34 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.resx (.../Resources.resx) (revision b7f9c9f43aac18c45ea1932f4559a29eda7fbe34) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Properties/Resources.resx (.../Resources.resx) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -312,4 +312,11 @@ De ondergrondschematisatie '{0}' bestaat niet. + + + ..\Resources\PipingConfigurationSchema.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + + ..\Resources\XmlGeometrySchema.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/PipingConfigurationReader.cs =================================================================== diff -u -rb7f9c9f43aac18c45ea1932f4559a29eda7fbe34 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/PipingConfigurationReader.cs (.../PipingConfigurationReader.cs) (revision b7f9c9f43aac18c45ea1932f4559a29eda7fbe34) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Readers/PipingConfigurationReader.cs (.../PipingConfigurationReader.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -144,13 +144,9 @@ private static XmlSchemaSet LoadXmlSchema() { - Stream schemaFile = AssemblyUtils.GetAssemblyResourceStream(typeof(PipingConfigurationReader).Assembly, - "Ringtoets.Piping.IO.Schema.PipingConfigurationSchema.xsd"); - - var xmlSchema = new XmlSchemaSet(); - xmlSchema.Add(XmlSchema.Read(schemaFile, null)); - - return xmlSchema; + var xmlSchemaSet = new XmlSchemaSet(); + xmlSchemaSet.Add(XmlSchema.Read(new StringReader(Resources.PipingConfigurationSchema), null)); + return xmlSchemaSet; } /// @@ -206,9 +202,9 @@ SurfaceLine = GetStringValueFromChildElement(calculationElement, PipingConfigurationSchemaIdentifiers.SurfaceLineElement), EntryPointL = GetDoubleValueFromChildElement(calculationElement, - PipingConfigurationSchemaIdentifiers.EntryPointElement), + PipingConfigurationSchemaIdentifiers.EntryPointLElement), ExitPointL = GetDoubleValueFromChildElement(calculationElement, - PipingConfigurationSchemaIdentifiers.ExitPointElement), + PipingConfigurationSchemaIdentifiers.ExitPointLElement), StochasticSoilModel = GetStringValueFromChildElement(calculationElement, PipingConfigurationSchemaIdentifiers.StochasticSoilModelElement), StochasticSoilProfile = GetStringValueFromChildElement(calculationElement, Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Resources/PipingConfigurationSchema.xsd =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Resources/PipingConfigurationSchema.xsd (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Resources/PipingConfigurationSchema.xsd (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Resources/XmlGeometrySchema.xsd =================================================================== diff -u --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Resources/XmlGeometrySchema.xsd (revision 0) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Resources/XmlGeometrySchema.xsd (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Ringtoets.Piping.IO.csproj =================================================================== diff -u -re45d53ab48741d0112dca1ad6bb6cf199535c8b7 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Ringtoets.Piping.IO.csproj (.../Ringtoets.Piping.IO.csproj) (revision e45d53ab48741d0112dca1ad6bb6cf199535c8b7) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Ringtoets.Piping.IO.csproj (.../Ringtoets.Piping.IO.csproj) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -60,6 +60,11 @@ + + True + True + Resources.resx + @@ -88,11 +93,6 @@ - - True - True - Resources.resx - @@ -136,8 +136,8 @@ PublicResXFileCodeGenerator - Resources.Designer.cs Designer + Resources.Designer.cs @@ -160,18 +160,16 @@ - - Designer - - - Copying.licenseheader - + Designer - + + + Designer + Fisheye: Tag 6928d01beb183acca2937ed5835e951e999be5cb refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.IO/Schema/PipingConfigurationSchema.xsd'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Schema/PipingConfigurationSchemaIdentifiers.cs =================================================================== diff -u -rec54ae2880790e8111aef31be951080dd818a4fe -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Schema/PipingConfigurationSchemaIdentifiers.cs (.../PipingConfigurationSchemaIdentifiers.cs) (revision ec54ae2880790e8111aef31be951080dd818a4fe) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Schema/PipingConfigurationSchemaIdentifiers.cs (.../PipingConfigurationSchemaIdentifiers.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -27,88 +27,88 @@ internal static class PipingConfigurationSchemaIdentifiers { /// - /// Gets the identifier for root elements. + /// The identifier for root elements. /// - internal static string RootElement => "root"; + internal const string RootElement = "root"; /// - /// Gets the identifier for calculation elements. + /// The identifier for calculation elements. /// - internal static string CalculationElement => "berekening"; + internal const string CalculationElement = "berekening"; /// - /// Gets the identifier for folder elements. + /// The identifier for folder elements. /// - internal static string FolderElement => "map"; + internal const string FolderElement = "map"; /// - /// Gets the identifier for name attributes. + /// The identifier for name attributes. /// - internal static string NameAttribute => "naam"; + internal const string NameAttribute = "naam"; /// - /// Gets the identifier for assessment level elements. + /// The identifier for assessment level elements. /// - internal static string AssessmentLevelElement => "toetspeil"; + internal const string AssessmentLevelElement = "toetspeil"; /// - /// Gets the identifier for hydraulic boundary location elements. + /// The identifier for hydraulic boundary location elements. /// - internal static string HydraulicBoundaryLocationElement => "hrlocatie"; + internal const string HydraulicBoundaryLocationElement = "hrlocatie"; /// - /// Gets the identifier for surface line elements. + /// The identifier for surface line elements. /// - internal static string SurfaceLineElement => "profielschematisatie"; + internal const string SurfaceLineElement = "profielschematisatie"; /// - /// Gets the identifier for entry point elements. + /// The identifier for entry point elements. /// - internal static string EntryPointElement => "intredepunt"; + internal const string EntryPointLElement = "intredepunt"; /// - /// Gets the identifier for exit point elements. + /// The identifier for exit point elements. /// - internal static string ExitPointElement => "uittredepunt"; + internal const string ExitPointLElement = "uittredepunt"; /// - /// Gets the identifier for stochastic soil model elements. + /// The identifier for stochastic soil model elements. /// - internal static string StochasticSoilModelElement => "ondergrondmodel"; + internal const string StochasticSoilModelElement = "ondergrondmodel"; /// - /// Gets the identifier for stochastic soil profile elements. + /// The identifier for stochastic soil profile elements. /// - internal static string StochasticSoilProfileElement => "ondergrondschematisatie"; + internal const string StochasticSoilProfileElement = "ondergrondschematisatie"; /// - /// Gets the identifier for stochasts elements. + /// The identifier for stochasts elements. /// - internal static string StochastsElement => "stochasten"; + internal const string StochastsElement = "stochasten"; /// - /// Gets the identifier for stochast elements. + /// The identifier for stochast elements. /// - internal static string StochastElement => "stochast"; + internal const string StochastElement = "stochast"; /// - /// Gets the identifier for mean elements. + /// The identifier for mean elements. /// - internal static string MeanElement => "verwachtingswaarde"; + internal const string MeanElement = "verwachtingswaarde"; /// - /// Gets the identifier for standard deviation elements. + /// The identifier for standard deviation elements. /// - internal static string StandardDeviationElement => "standaardafwijking"; + internal const string StandardDeviationElement = "standaardafwijking"; /// - /// Gets the identifier for the phreatic level exit stochast names. + /// The identifier for the phreatic level exit stochast names. /// - internal static string PhreaticLevelExitStochastName => "polderpeil"; + internal const string PhreaticLevelExitStochastName = "polderpeil"; /// - /// Gets the identifier for the damping factor exit stochast names. + /// The identifier for the damping factor exit stochast names. /// - internal static string DampingFactorExitStochastName => "dempingsfactor"; + internal const string DampingFactorExitStochastName = "dempingsfactor"; } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/SoilLayer2DReader.cs =================================================================== diff -u -rb7f9c9f43aac18c45ea1932f4559a29eda7fbe34 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/SoilLayer2DReader.cs (.../SoilLayer2DReader.cs) (revision b7f9c9f43aac18c45ea1932f4559a29eda7fbe34) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/SoilLayer2DReader.cs (.../SoilLayer2DReader.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -29,7 +29,6 @@ using System.Xml.Schema; using System.Xml.XPath; using Core.Common.Base.Geometry; -using Core.Common.Utils.Reflection; using Ringtoets.Piping.IO.Builders; using Ringtoets.Piping.IO.Exceptions; using Ringtoets.Piping.IO.Properties; @@ -134,13 +133,11 @@ } } - private XmlSchemaSet LoadXmlSchema() + private static XmlSchemaSet LoadXmlSchema() { - var schemaFile = AssemblyUtils.GetAssemblyResourceStream(GetType().Assembly, - "Ringtoets.Piping.IO.SoilProfile.XmlGeometrySchema.xsd"); - var xmlSchema = new XmlSchemaSet(); - xmlSchema.Add(XmlSchema.Read(schemaFile, null)); - return xmlSchema; + var xmlSchemaSet = new XmlSchemaSet(); + xmlSchemaSet.Add(XmlSchema.Read(new StringReader(Resources.XmlGeometrySchema), null)); + return xmlSchemaSet; } /// @@ -198,7 +195,7 @@ return new Segment2D( ParsePoint(headDefinition), ParsePoint(endDefinition) - ); + ); } throw new SoilLayerConversionException(Resources.SoilLayer2DReader_Geometry_contains_no_valid_xml); } Fisheye: Tag 6928d01beb183acca2937ed5835e951e999be5cb refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.IO/SoilProfile/XmlGeometrySchema.xsd'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Exporters/PipingConfigurationWriterTest.cs =================================================================== diff -u -rf43c22c9f5dc04d352988510303fcfe12d712be8 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Exporters/PipingConfigurationWriterTest.cs (.../PipingConfigurationWriterTest.cs) (revision f43c22c9f5dc04d352988510303fcfe12d712be8) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Exporters/PipingConfigurationWriterTest.cs (.../PipingConfigurationWriterTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -152,16 +152,18 @@ public void Write_FileInUse_ThrowCriticalFileWriteException() { // Setup - string filePath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); - using (new FileDisposeHelper(filePath)) - using (new FileStream(filePath, FileMode.Open)) + string path = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); + + using (var fileDisposeHelper = new FileDisposeHelper(path)) { + fileDisposeHelper.LockFiles(); + // Call - TestDelegate call = () => PipingConfigurationWriter.Write(new CalculationGroup(), filePath); + TestDelegate call = () => PipingConfigurationWriter.Write(new CalculationGroup(), path); // Assert var exception = Assert.Throws(call); - Assert.AreEqual($"Er is een onverwachte fout opgetreden tijdens het schrijven van het bestand '{filePath}'.", exception.Message); + Assert.AreEqual($"Er is een onverwachte fout opgetreden tijdens het schrijven van het bestand '{path}'.", exception.Message); Assert.IsInstanceOf(exception.InnerException); } } Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/PipingConfigurationReaderTest.cs =================================================================== diff -u -ref8341b9d75b82a9c652f5c2ef0c4108252c5fb8 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/PipingConfigurationReaderTest.cs (.../PipingConfigurationReaderTest.cs) (revision ef8341b9d75b82a9c652f5c2ef0c4108252c5fb8) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Readers/PipingConfigurationReaderTest.cs (.../PipingConfigurationReaderTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -234,15 +234,17 @@ public void Constructor_FileInUse_ThrowCriticalFileReadException() { // Setup - string filePath = Path.Combine(testDirectoryPath, "validConfigurationNesting.xml"); + string path = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); - using (new FileStream(filePath, FileMode.Open)) + using (var fileDisposeHelper = new FileDisposeHelper(path)) { + fileDisposeHelper.LockFiles(); + // Call - TestDelegate call = () => new PipingConfigurationReader(filePath); + TestDelegate call = () => new PipingConfigurationReader(path); // Assert - string expectedMessage = $"Fout bij het lezen van bestand '{filePath}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; + string expectedMessage = $"Fout bij het lezen van bestand '{path}': het bestand kon niet worden geopend. Mogelijk is het bestand corrupt of in gebruik door een andere applicatie."; var exception = Assert.Throws(call); Assert.AreEqual(expectedMessage, exception.Message); Assert.IsInstanceOf(exception.InnerException); Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Schema/PipingConfigurationSchemaIdentifiersTest.cs =================================================================== diff -u -rf648a2ccf55c5a0f35eed517e3d2f6d9ded20ab7 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Schema/PipingConfigurationSchemaIdentifiersTest.cs (.../PipingConfigurationSchemaIdentifiersTest.cs) (revision f648a2ccf55c5a0f35eed517e3d2f6d9ded20ab7) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Schema/PipingConfigurationSchemaIdentifiersTest.cs (.../PipingConfigurationSchemaIdentifiersTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -37,8 +37,8 @@ Assert.AreEqual("toetspeil", PipingConfigurationSchemaIdentifiers.AssessmentLevelElement); Assert.AreEqual("hrlocatie", PipingConfigurationSchemaIdentifiers.HydraulicBoundaryLocationElement); Assert.AreEqual("profielschematisatie", PipingConfigurationSchemaIdentifiers.SurfaceLineElement); - Assert.AreEqual("intredepunt", PipingConfigurationSchemaIdentifiers.EntryPointElement); - Assert.AreEqual("uittredepunt", PipingConfigurationSchemaIdentifiers.ExitPointElement); + Assert.AreEqual("intredepunt", PipingConfigurationSchemaIdentifiers.EntryPointLElement); + Assert.AreEqual("uittredepunt", PipingConfigurationSchemaIdentifiers.ExitPointLElement); Assert.AreEqual("ondergrondmodel", PipingConfigurationSchemaIdentifiers.StochasticSoilModelElement); Assert.AreEqual("ondergrondschematisatie", PipingConfigurationSchemaIdentifiers.StochasticSoilProfileElement); Assert.AreEqual("stochasten", PipingConfigurationSchemaIdentifiers.StochastsElement); Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditionsWriterTest.cs =================================================================== diff -u -rf43c22c9f5dc04d352988510303fcfe12d712be8 -r6928d01beb183acca2937ed5835e951e999be5cb --- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditionsWriterTest.cs (.../WaveConditionsWriterTest.cs) (revision f43c22c9f5dc04d352988510303fcfe12d712be8) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/WaveConditionsWriterTest.cs (.../WaveConditionsWriterTest.cs) (revision 6928d01beb183acca2937ed5835e951e999be5cb) @@ -119,16 +119,18 @@ public void WriteWaveConditions_FileInUse_ThrowCriticalFileWriteException() { // Setup - string filePath = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); - using (new FileDisposeHelper(filePath)) - using (new FileStream(filePath, FileMode.Open)) + string path = TestHelper.GetScratchPadPath(Path.GetRandomFileName()); + + using (var fileDisposeHelper = new FileDisposeHelper(path)) { + fileDisposeHelper.LockFiles(); + // Call - TestDelegate call = () => WaveConditionsWriter.WriteWaveConditions(Enumerable.Empty(), filePath); + TestDelegate call = () => WaveConditionsWriter.WriteWaveConditions(Enumerable.Empty(), path); // Assert var exception = Assert.Throws(call); - Assert.AreEqual($"Er is een onverwachte fout opgetreden tijdens het schrijven van het bestand '{filePath}'.", exception.Message); + Assert.AreEqual($"Er is een onverwachte fout opgetreden tijdens het schrijven van het bestand '{path}'.", exception.Message); Assert.IsInstanceOf(exception.InnerException); } } @@ -139,7 +141,7 @@ // Setup ExportableWaveConditions[] exportableWaveConditions = { - new ExportableWaveConditions("blocksName", new WaveConditionsInput() + new ExportableWaveConditions("blocksName", new WaveConditionsInput { HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, string.Empty, 0, 0) {