Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Configurations/AssessmentSectionCategoryWaveConditionsCalculationConfigurationReader.cs =================================================================== diff -u -rb836b0dab258dc7c414d3f65e2d30bb4b5096ae7 -r85b7f2b6d2eec9850c023e7146a64f6250e9ba6d --- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Configurations/AssessmentSectionCategoryWaveConditionsCalculationConfigurationReader.cs (.../AssessmentSectionCategoryWaveConditionsCalculationConfigurationReader.cs) (revision b836b0dab258dc7c414d3f65e2d30bb4b5096ae7) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Configurations/AssessmentSectionCategoryWaveConditionsCalculationConfigurationReader.cs (.../AssessmentSectionCategoryWaveConditionsCalculationConfigurationReader.cs) (revision 85b7f2b6d2eec9850c023e7146a64f6250e9ba6d) @@ -25,6 +25,7 @@ using Ringtoets.Common.IO.Configurations; using Ringtoets.Common.IO.Configurations.Helpers; using Ringtoets.Revetment.IO.Configurations.Converters; +using Ringtoets.Revetment.IO.Properties; namespace Ringtoets.Revetment.IO.Configurations { @@ -48,7 +49,7 @@ /// /// public AssessmentSectionCategoryWaveConditionsCalculationConfigurationReader(string xmlFilePath) - : base(xmlFilePath) {} + : base(xmlFilePath, Resources.BekledingenHrConfiguratieSchema) {} protected override AssessmentSectionCategoryWaveConditionsCalculationConfiguration ParseCalculationElement(XElement calculationElement) { Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Configurations/WaveConditionsCalculationConfigurationReader.cs =================================================================== diff -u -r4b0f1379401d8be472d46647930a337aa0e9fc9f -r85b7f2b6d2eec9850c023e7146a64f6250e9ba6d --- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Configurations/WaveConditionsCalculationConfigurationReader.cs (.../WaveConditionsCalculationConfigurationReader.cs) (revision 4b0f1379401d8be472d46647930a337aa0e9fc9f) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Configurations/WaveConditionsCalculationConfigurationReader.cs (.../WaveConditionsCalculationConfigurationReader.cs) (revision 85b7f2b6d2eec9850c023e7146a64f6250e9ba6d) @@ -44,26 +44,31 @@ private const string orientationSchemaName = "OrientatieSchema.xsd"; private const string foreshoreProfileSchemaName = "VoorlandProfielSchema.xsd"; private const string waveReductionSchemaName = "GolfReductieSchema.xsd"; + private const string revetmentBaseSchemaName = "BekledingenHrConfiguratieSchemaBasis.xsd"; /// /// Creates a new instance of . /// /// The file path to the XML file. + /// A string representing the main schema definition. /// Thrown when is invalid. /// Thrown when: /// /// points to a file that does not exist. /// points to a file that does not contain valid XML. /// points to a file that does not pass the schema validation. /// points to a file that does not contain configuration elements. + /// is invalid. /// /// - protected WaveConditionsCalculationConfigurationReader(string xmlFilePath) - : base(xmlFilePath, - Resources.BekledingenHrConfiguratieSchema, + protected WaveConditionsCalculationConfigurationReader(string xmlFilePath, string mainSchemaDefinition) + : base(xmlFilePath, mainSchemaDefinition, new Dictionary { { + revetmentBaseSchemaName, Resources.BekledingenHrConfiguratieSchemaBasis + }, + { hydraulicBoundaryLocationSchemaName, RingtoetsCommonIOResources.HrLocatieSchema }, { Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Properties/Resources.Designer.cs =================================================================== diff -u -rbb81cbc775643d95f096bddf5e5dbdae234cf921 -r85b7f2b6d2eec9850c023e7146a64f6250e9ba6d --- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision bb81cbc775643d95f096bddf5e5dbdae234cf921) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 85b7f2b6d2eec9850c023e7146a64f6250e9ba6d) @@ -118,7 +118,7 @@ } /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8"?><!-- + /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8"?><!-- ///Copyright (C) Stichting Deltares 2017. All rights reserved. /// ///This file is part of Ringtoets. @@ -138,6 +138,26 @@ } /// + /// Looks up a localized string similar to <?xml version="1.0" encoding="UTF-8"?><!-- + ///Copyright (C) Stichting Deltares 2017. 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 [rest of string was truncated]";. + /// + internal static string BekledingenHrConfiguratieSchemaBasis { + get { + return ResourceManager.GetString("BekledingenHrConfiguratieSchemaBasis", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Asfalt. /// internal static string CoverType_Asphalt { Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Properties/Resources.resx =================================================================== diff -u -rbb81cbc775643d95f096bddf5e5dbdae234cf921 -r85b7f2b6d2eec9850c023e7146a64f6250e9ba6d --- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Properties/Resources.resx (.../Resources.resx) (revision bb81cbc775643d95f096bddf5e5dbdae234cf921) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Properties/Resources.resx (.../Resources.resx) (revision 85b7f2b6d2eec9850c023e7146a64f6250e9ba6d) @@ -142,8 +142,8 @@ Gras - - ..\Resources\BekledingenHrConfiguratieSchema.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + ..\Resources\BekledingenHrConfiguratieSchemaBasis.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 bovengrens bekledingen @@ -169,4 +169,7 @@ A-B + + ..\resources\BekledingenHrConfiguratieSchema.xsd;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + \ No newline at end of file Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Resources/BekledingenHrConfiguratieSchema.xsd =================================================================== diff -u -r3ddd2e86216438a423797aecd4b1f9808df00bcb -r85b7f2b6d2eec9850c023e7146a64f6250e9ba6d --- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Resources/BekledingenHrConfiguratieSchema.xsd (.../BekledingenHrConfiguratieSchema.xsd) (revision 3ddd2e86216438a423797aecd4b1f9808df00bcb) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Resources/BekledingenHrConfiguratieSchema.xsd (.../BekledingenHrConfiguratieSchema.xsd) (revision 85b7f2b6d2eec9850c023e7146a64f6250e9ba6d) @@ -1,4 +1,4 @@ - + - - + + + - @@ -40,67 +41,13 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -112,5 +59,4 @@ - \ No newline at end of file Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Resources/BekledingenHrConfiguratieSchemaBasis.xsd =================================================================== diff -u --- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Resources/BekledingenHrConfiguratieSchemaBasis.xsd (revision 0) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Resources/BekledingenHrConfiguratieSchemaBasis.xsd (revision 85b7f2b6d2eec9850c023e7146a64f6250e9ba6d) @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Index: Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Ringtoets.Revetment.IO.csproj =================================================================== diff -u -rbb81cbc775643d95f096bddf5e5dbdae234cf921 -r85b7f2b6d2eec9850c023e7146a64f6250e9ba6d --- Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Ringtoets.Revetment.IO.csproj (.../Ringtoets.Revetment.IO.csproj) (revision bb81cbc775643d95f096bddf5e5dbdae234cf921) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.IO/Ringtoets.Revetment.IO.csproj (.../Ringtoets.Revetment.IO.csproj) (revision 85b7f2b6d2eec9850c023e7146a64f6250e9ba6d) @@ -48,6 +48,9 @@ Copying.licenseheader + + Designer + Designer Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Configurations/WaveConditionsCalculationConfigurationReaderTest.cs =================================================================== diff -u -r4b0f1379401d8be472d46647930a337aa0e9fc9f -r85b7f2b6d2eec9850c023e7146a64f6250e9ba6d --- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Configurations/WaveConditionsCalculationConfigurationReaderTest.cs (.../WaveConditionsCalculationConfigurationReaderTest.cs) (revision 4b0f1379401d8be472d46647930a337aa0e9fc9f) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Configurations/WaveConditionsCalculationConfigurationReaderTest.cs (.../WaveConditionsCalculationConfigurationReaderTest.cs) (revision 85b7f2b6d2eec9850c023e7146a64f6250e9ba6d) @@ -30,12 +30,15 @@ using Ringtoets.Common.IO.Configurations; using Ringtoets.Common.IO.Configurations.Import; using Ringtoets.Revetment.IO.Configurations; +using Ringtoets.Revetment.IO.Properties; namespace Ringtoets.Revetment.IO.Test.Configurations { [TestFixture] public class WaveConditionsCalculationConfigurationReaderTest { + private string validMainSchemaDefinition; + private readonly string testDirectoryPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Revetment.IO, nameof(WaveConditionsCalculationConfigurationReader)); @@ -154,14 +157,20 @@ } } + [OneTimeSetUp] + public void OneTimeSetUp() + { + validMainSchemaDefinition = File.ReadAllText(Path.Combine(testDirectoryPath, "validConfigurationSchema.xsd")); + } + [Test] public void Constructor_ExpectedValues() { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationEmptyCalculation.xml"); // Call - var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath, validMainSchemaDefinition); // Assert Assert.IsInstanceOf>(reader); @@ -175,7 +184,7 @@ string filePath = Path.Combine(testDirectoryPath, fileName); // Call - TestDelegate call = () => new TestWaveConditionsCalculationConfigurationReader(filePath); + TestDelegate call = () => new TestWaveConditionsCalculationConfigurationReader(filePath, validMainSchemaDefinition); // Assert var exception = Assert.Throws(call); @@ -188,7 +197,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationEmptyCalculation.xml"); - var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath, validMainSchemaDefinition); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -213,7 +222,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationCalculationContainingEmptyWaveReduction.xml"); - var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath, validMainSchemaDefinition); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -233,7 +242,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationCalculationContainingNaNs.xml"); - var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath, validMainSchemaDefinition); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -255,7 +264,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationCalculationContaininInfinities.xml"); - var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath, validMainSchemaDefinition); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -287,7 +296,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, fileName); - var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath, validMainSchemaDefinition); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -315,7 +324,7 @@ { // Setup string filePath = Path.Combine(testDirectoryPath, "validConfigurationPartialCalculation.xml"); - var reader = new TestWaveConditionsCalculationConfigurationReader(filePath); + var reader = new TestWaveConditionsCalculationConfigurationReader(filePath, validMainSchemaDefinition); // Call IEnumerable readItems = reader.Read().ToArray(); @@ -341,8 +350,8 @@ private class TestWaveConditionsCalculationConfigurationReader : WaveConditionsCalculationConfigurationReader { - public TestWaveConditionsCalculationConfigurationReader(string xmlFilePath) - : base(xmlFilePath) {} + public TestWaveConditionsCalculationConfigurationReader(string xmlFilePath, string configurationSchema) + : base(xmlFilePath, configurationSchema) {} protected override WaveConditionsCalculationConfiguration ParseCalculationElement(XElement calculationElement) { Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/test-data/WaveConditionsCalculationConfigurationReader/validConfigurationSchema.xsd =================================================================== diff -u --- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/test-data/WaveConditionsCalculationConfigurationReader/validConfigurationSchema.xsd (revision 0) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/test-data/WaveConditionsCalculationConfigurationReader/validConfigurationSchema.xsd (revision 85b7f2b6d2eec9850c023e7146a64f6250e9ba6d) @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file