Index: Ringtoets/Common/src/Ringtoets.Common.IO/Exporters/ConfigurationExporter.cs =================================================================== diff -u -r020439f88aaed9dd51967acbc8518f37c95791d1 -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/Common/src/Ringtoets.Common.IO/Exporters/ConfigurationExporter.cs (.../ConfigurationExporter.cs) (revision 020439f88aaed9dd51967acbc8518f37c95791d1) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Exporters/ConfigurationExporter.cs (.../ConfigurationExporter.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Collections.Generic; using Core.Common.Base.IO; using Core.Common.IO.Exceptions; using Core.Common.Utils; @@ -38,34 +39,34 @@ where TWriter : CalculationConfigurationWriter, new() { private static readonly ILog log = LogManager.GetLogger(typeof(ConfigurationExporter)); - private readonly CalculationGroup calculationGroup; + private readonly IEnumerable configuration; private readonly string filePath; /// /// Creates a new instance of . /// - /// The calculation group to export. + /// The configuration to export. /// The path of the XML file to export to. - /// Thrown when is null. + /// Thrown when is null. /// Thrown when is invalid. - protected ConfigurationExporter(CalculationGroup calculationGroup, string filePath) + protected ConfigurationExporter(IEnumerable configuration, string filePath) { - if (calculationGroup == null) + if (configuration == null) { - throw new ArgumentNullException(nameof(calculationGroup)); + throw new ArgumentNullException(nameof(configuration)); } IOUtils.ValidateFilePath(filePath); - this.calculationGroup = calculationGroup; + this.configuration = configuration; this.filePath = filePath; } public bool Export() { try { - new TWriter().Write(calculationGroup.Children, filePath); + new TWriter().Write(configuration, filePath); } catch (CriticalFileWriteException e) { Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Exporters/ConfigurationExporterTest.cs =================================================================== diff -u -r5735c9b5c663a0bc7762d1b1eb1483e5c4cfe526 -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Exporters/ConfigurationExporterTest.cs (.../ConfigurationExporterTest.cs) (revision 5735c9b5c663a0bc7762d1b1eb1483e5c4cfe526) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Exporters/ConfigurationExporterTest.cs (.../ConfigurationExporterTest.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -20,7 +20,9 @@ // All rights reserved. using System; +using System.Collections.Generic; using System.IO; +using System.Linq; using System.Security.AccessControl; using System.Xml; using Core.Common.Base.IO; @@ -40,21 +42,21 @@ public void Constructor_ExpectedValues() { // Call - var exporter = new SimpleConfigurationExporter(new CalculationGroup(), "test.xml"); + var exporter = new SimpleConfigurationExporter(Enumerable.Empty(), "test.xml"); // Assert Assert.IsInstanceOf(exporter); } [Test] - public void Constructor_CalculationGroupNull_ThrowArgumentNullException() + public void Constructor_ConfigurationNull_ThrowArgumentNullException() { // Call TestDelegate test = () => new SimpleConfigurationExporter(null, "test.xml"); // Assert var exception = Assert.Throws(test); - Assert.AreEqual("calculationGroup", exception.ParamName); + Assert.AreEqual("configuration", exception.ParamName); } [Test] @@ -64,7 +66,7 @@ public void Constructor_FilePathInvalid_ThrowArgumentException(string filePath) { // Call - TestDelegate test = () => new SimpleConfigurationExporter(new CalculationGroup(), filePath); + TestDelegate test = () => new SimpleConfigurationExporter(Enumerable.Empty(), filePath); // Assert Assert.Throws(test); @@ -103,16 +105,11 @@ } }; - var rootGroup = new CalculationGroup("root", false) + var exporter = new SimpleConfigurationExporter(new[] { - Children = - { - calculationGroup - } - }; + calculationGroup + }, targetFilePath); - var exporter = new SimpleConfigurationExporter(rootGroup, targetFilePath); - try { // Call @@ -137,20 +134,15 @@ public void Export_InvalidDirectoryRights_LogErrorAndReturnFalse() { // Setup - var calculationGroup = new CalculationGroup - { - Children = - { - new TestCalculation("Calculation A") - } - }; - string directoryPath = TestHelper.GetScratchPadPath(nameof(Export_InvalidDirectoryRights_LogErrorAndReturnFalse)); using (var disposeHelper = new DirectoryDisposeHelper(TestHelper.GetScratchPadPath(), nameof(Export_InvalidDirectoryRights_LogErrorAndReturnFalse))) { string filePath = Path.Combine(directoryPath, "test.xml"); - var exporter = new SimpleConfigurationExporter(calculationGroup, filePath); + var exporter = new SimpleConfigurationExporter(new[] + { + new TestCalculation("Calculation A") + }, filePath); disposeHelper.LockDirectory(FileSystemRights.Write); @@ -169,7 +161,7 @@ public class SimpleConfigurationExporter : ConfigurationExporter { - public SimpleConfigurationExporter(CalculationGroup calculationGroup, string targetFilePath) : base(calculationGroup, targetFilePath) {} + public SimpleConfigurationExporter(IEnumerable configuration, string targetFilePath) : base(configuration, targetFilePath) {} } public class SimpleCalculationConfigurationWriter : CalculationConfigurationWriter Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/GrassCoverErosionInwardsConfigurationExporter.cs =================================================================== diff -u -r2923096aeb41e1fb5d4ba0ad43ccb9f95ca7407a -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/GrassCoverErosionInwardsConfigurationExporter.cs (.../GrassCoverErosionInwardsConfigurationExporter.cs) (revision 2923096aeb41e1fb5d4ba0ad43ccb9f95ca7407a) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.IO/GrassCoverErosionInwardsConfigurationExporter.cs (.../GrassCoverErosionInwardsConfigurationExporter.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Collections.Generic; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.IO.Exporters; using Ringtoets.GrassCoverErosionInwards.Data; @@ -36,11 +37,11 @@ /// /// Creates a new instance of . /// - /// The calculation group to export. + /// The configuration to export. /// The path of the XML file to export to. - /// Thrown when is null. + /// Thrown when is null. /// Thrown when is invalid. - public GrassCoverErosionInwardsConfigurationExporter(CalculationGroup calculationGroup, string filePath) - : base(calculationGroup, filePath) { } + public GrassCoverErosionInwardsConfigurationExporter(IEnumerable configuration, string filePath) + : base(configuration, filePath) { } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs =================================================================== diff -u -r0d29de0eb92a426c8e1b3725656a3f608b93f951 -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision 0d29de0eb92a426c8e1b3725656a3f608b93f951) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -83,7 +83,7 @@ { FileFilterGenerator = new FileFilterGenerator(RingtoetsCommonFormsResources.DataTypeDisplayName_xml_file_filter_Extension, RingtoetsCommonFormsResources.DataTypeDisplayName_xml_file_filter_Description), - CreateFileExporter = (context, filePath) => new GrassCoverErosionInwardsConfigurationExporter(context.WrappedData, filePath), + CreateFileExporter = (context, filePath) => new GrassCoverErosionInwardsConfigurationExporter(context.WrappedData.Children, filePath), IsEnabled = context => context.WrappedData.Children.Any() }; } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/GrassCoverErosionInwardsConfigurationExporterTest.cs =================================================================== diff -u -r2923096aeb41e1fb5d4ba0ad43ccb9f95ca7407a -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/GrassCoverErosionInwardsConfigurationExporterTest.cs (.../GrassCoverErosionInwardsConfigurationExporterTest.cs) (revision 2923096aeb41e1fb5d4ba0ad43ccb9f95ca7407a) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/GrassCoverErosionInwardsConfigurationExporterTest.cs (.../GrassCoverErosionInwardsConfigurationExporterTest.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -21,11 +21,13 @@ using System; using System.IO; +using System.Linq; using System.Security.AccessControl; using Core.Common.Base.IO; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.IO.Exporters; using Ringtoets.GrassCoverErosionInwards.Data; namespace Ringtoets.GrassCoverErosionInwards.IO.Test @@ -37,37 +39,16 @@ public void Constructor_ExpectedValues() { // Call - var exporter = new GrassCoverErosionInwardsConfigurationExporter(new CalculationGroup(), "test.xml"); + var exporter = new GrassCoverErosionInwardsConfigurationExporter(Enumerable.Empty(), "test.xml"); // Assert - Assert.IsInstanceOf(exporter); + Assert.IsInstanceOf< + ConfigurationExporter< + GrassCoverErosionInwardsConfigurationWriter, + GrassCoverErosionInwardsCalculation>>(exporter); } [Test] - public void Constructor_CalculationGroupNull_ThrowArgumentNullException() - { - // Call - TestDelegate test = () => new GrassCoverErosionInwardsConfigurationExporter(null, "test.xml"); - - // Assert - var exception = Assert.Throws(test); - Assert.AreEqual("calculationGroup", exception.ParamName); - } - - [Test] - [TestCase("")] - [TestCase(" ")] - [TestCase("c:\\>")] - public void Constructor_FilePathInvalid_ThrowArgumentException(string filePath) - { - // Call - TestDelegate test = () => new GrassCoverErosionInwardsConfigurationExporter(new CalculationGroup(), filePath); - - // Assert - Assert.Throws(test); - } - - [Test] public void Export_ValidData_ReturnTrueAndWritesFile() { // Setup @@ -99,16 +80,11 @@ } }; - var rootGroup = new CalculationGroup("root", false) + var exporter = new GrassCoverErosionInwardsConfigurationExporter(new[] { - Children = - { - calculationGroup - } - }; + calculationGroup + }, filePath); - var exporter = new GrassCoverErosionInwardsConfigurationExporter(rootGroup, filePath); - try { // Call @@ -137,20 +113,15 @@ public void Export_InvalidDirectoryRights_LogErrorAndReturnFalse() { // Setup - var calculationGroup = new CalculationGroup - { - Children = - { - new GrassCoverErosionInwardsCalculation() - } - }; - string directoryPath = TestHelper.GetScratchPadPath(nameof(Export_InvalidDirectoryRights_LogErrorAndReturnFalse)); using (var disposeHelper = new DirectoryDisposeHelper(TestHelper.GetScratchPadPath(), nameof(Export_InvalidDirectoryRights_LogErrorAndReturnFalse))) { string filePath = Path.Combine(directoryPath, "test.xml"); - var exporter = new GrassCoverErosionInwardsConfigurationExporter(calculationGroup, filePath); + var exporter = new GrassCoverErosionInwardsConfigurationExporter(new[] + { + new GrassCoverErosionInwardsCalculation() + }, filePath); disposeHelper.LockDirectory(FileSystemRights.Write); Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/GrassCoverErosionOutwardsConfigurationExporter.cs =================================================================== diff -u -r633aedbd4c882f2811c3e8e6653ef352301c40b5 -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/GrassCoverErosionOutwardsConfigurationExporter.cs (.../GrassCoverErosionOutwardsConfigurationExporter.cs) (revision 633aedbd4c882f2811c3e8e6653ef352301c40b5) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.IO/GrassCoverErosionOutwardsConfigurationExporter.cs (.../GrassCoverErosionOutwardsConfigurationExporter.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Collections.Generic; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.IO.Exporters; using Ringtoets.GrassCoverErosionOutwards.Data; @@ -35,11 +36,11 @@ /// /// Creates a new instance of . /// - /// The calculation group to export. + /// The configuration to export. /// The path of the XML file to export to. - /// Thrown when is null. + /// Thrown when is null. /// Thrown when is invalid. - public GrassCoverErosionOutwardsConfigurationExporter(CalculationGroup calculationGroup, string filePath) - : base(calculationGroup, filePath) {} + public GrassCoverErosionOutwardsConfigurationExporter(IEnumerable configuration, string filePath) + : base(configuration, filePath) {} } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs =================================================================== diff -u -rd04efd93e668625dd987f6987e8273fc613a2f21 -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision d04efd93e668625dd987f6987e8273fc613a2f21) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -286,7 +286,7 @@ yield return new ExportInfo { Name = RingtoetsCommonFormsResources.ConfigurationExporter_DisplayName, - CreateFileExporter = (context, filePath) => new GrassCoverErosionOutwardsConfigurationExporter(context.WrappedData, filePath), + CreateFileExporter = (context, filePath) => new GrassCoverErosionOutwardsConfigurationExporter(context.WrappedData.Children, filePath), IsEnabled = context => context.WrappedData.Children.Any(), FileFilterGenerator = new FileFilterGenerator(RingtoetsCommonFormsResources.DataTypeDisplayName_xml_file_filter_Extension, RingtoetsCommonFormsResources.DataTypeDisplayName_xml_file_filter_Description) Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/GrassCoverErosionOutwardsConfigurationExporterTest.cs =================================================================== diff -u -r633aedbd4c882f2811c3e8e6653ef352301c40b5 -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/GrassCoverErosionOutwardsConfigurationExporterTest.cs (.../GrassCoverErosionOutwardsConfigurationExporterTest.cs) (revision 633aedbd4c882f2811c3e8e6653ef352301c40b5) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.IO.Test/GrassCoverErosionOutwardsConfigurationExporterTest.cs (.../GrassCoverErosionOutwardsConfigurationExporterTest.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -20,6 +20,7 @@ // All rights reserved. using System.IO; +using System.Linq; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Calculation; @@ -37,7 +38,7 @@ public void Constructor_ExpectedValues() { // Call - var exporter = new GrassCoverErosionOutwardsConfigurationExporter(new CalculationGroup(), "test.xml"); + var exporter = new GrassCoverErosionOutwardsConfigurationExporter(Enumerable.Empty(), "test.xml"); // Assert Assert.IsInstanceOf< @@ -88,16 +89,11 @@ } }; - var rootGroup = new CalculationGroup("root", false) + var exporter = new GrassCoverErosionOutwardsConfigurationExporter(new [] { - Children = - { - calculationGroup - } - }; + calculationGroup + }, filePath); - var exporter = new GrassCoverErosionOutwardsConfigurationExporter(rootGroup, filePath); - try { // Call Index: Ringtoets/Piping/src/Ringtoets.Piping.IO/Exporters/PipingConfigurationExporter.cs =================================================================== diff -u -r5735c9b5c663a0bc7762d1b1eb1483e5c4cfe526 -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/Piping/src/Ringtoets.Piping.IO/Exporters/PipingConfigurationExporter.cs (.../PipingConfigurationExporter.cs) (revision 5735c9b5c663a0bc7762d1b1eb1483e5c4cfe526) +++ Ringtoets/Piping/src/Ringtoets.Piping.IO/Exporters/PipingConfigurationExporter.cs (.../PipingConfigurationExporter.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Collections.Generic; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.IO.Exporters; using Ringtoets.Piping.Data; @@ -34,11 +35,11 @@ /// /// Creates a new instance of . /// - /// The calculation group to export. + /// The configuration to export. /// The path of the XML file to export to. - /// Thrown when is null. + /// Thrown when is null. /// Thrown when is invalid. - public PipingConfigurationExporter(CalculationGroup calculationGroup, string filePath) : base(calculationGroup, filePath) + public PipingConfigurationExporter(IEnumerable configuration, string filePath) : base(configuration, filePath) {} } } \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs =================================================================== diff -u -rc31353107227995d74e8727a85b02a89a39c139d -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision c31353107227995d74e8727a85b02a89a39c139d) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -140,7 +140,7 @@ yield return new ExportInfo { FileFilterGenerator = PipingConfigurationFileFilter, - CreateFileExporter = (context, filePath) => new PipingConfigurationExporter(context.WrappedData, filePath), + CreateFileExporter = (context, filePath) => new PipingConfigurationExporter(context.WrappedData.Children, filePath), IsEnabled = context => context.WrappedData.Children.Any() }; } Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Exporters/PipingConfigurationExporterTest.cs =================================================================== diff -u -r28ab332db2d96ad9e766f19677af1c00fc88a644 -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Exporters/PipingConfigurationExporterTest.cs (.../PipingConfigurationExporterTest.cs) (revision 28ab332db2d96ad9e766f19677af1c00fc88a644) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/Exporters/PipingConfigurationExporterTest.cs (.../PipingConfigurationExporterTest.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -21,13 +21,15 @@ using System; using System.IO; +using System.Linq; using System.Security.AccessControl; using Core.Common.Base.Data; using Core.Common.Base.IO; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.IO.Exporters; using Ringtoets.Piping.Data; using Ringtoets.Piping.Integration.TestUtils; using Ringtoets.Piping.IO.Exporters; @@ -42,37 +44,13 @@ public void Constructor_ExpectedValues() { // Call - var exporter = new PipingConfigurationExporter(new CalculationGroup(), "test.xml"); + var exporter = new PipingConfigurationExporter(Enumerable.Empty(), "test.xml"); // Assert - Assert.IsInstanceOf(exporter); + Assert.IsInstanceOf>(exporter); } [Test] - public void Constructor_CalculationGroupNull_ThrowArgumentNullException() - { - // Call - TestDelegate test = () => new PipingConfigurationExporter(null, "test.xml"); - - // Assert - var exception = Assert.Throws(test); - Assert.AreEqual("calculationGroup", exception.ParamName); - } - - [Test] - [TestCase("")] - [TestCase(" ")] - [TestCase("c:\\>")] - public void Constructor_FilePathInvalid_ThrowArgumentException(string filePath) - { - // Call - TestDelegate test = () => new PipingConfigurationExporter(new CalculationGroup(), filePath); - - // Assert - Assert.Throws(test); - } - - [Test] public void Export_ValidData_ReturnTrueAndWritesFile() { // Setup @@ -114,16 +92,11 @@ } }; - var rootGroup = new CalculationGroup("root", false) + var exporter = new PipingConfigurationExporter(new [] { - Children = - { - calculationGroup - } - }; + calculationGroup + }, filePath); - var exporter = new PipingConfigurationExporter(rootGroup, filePath); - try { // Call @@ -150,20 +123,15 @@ public void Export_InvalidDirectoryRights_LogErrorAndReturnFalse() { // Setup - var calculationGroup = new CalculationGroup - { - Children = - { - PipingTestDataGenerator.GetPipingCalculation() - } - }; - string directoryPath = TestHelper.GetScratchPadPath(nameof(Export_InvalidDirectoryRights_LogErrorAndReturnFalse)); using (var disposeHelper = new DirectoryDisposeHelper(TestHelper.GetScratchPadPath(), nameof(Export_InvalidDirectoryRights_LogErrorAndReturnFalse))) { string filePath = Path.Combine(directoryPath, "test.xml"); - var exporter = new PipingConfigurationExporter(calculationGroup, filePath); + var exporter = new PipingConfigurationExporter(new [] + { + PipingTestDataGenerator.GetPipingCalculation() + }, filePath); disposeHelper.LockDirectory(FileSystemRights.Write); Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.IO/StabilityStoneCoverConfigurationExporter.cs =================================================================== diff -u -r633aedbd4c882f2811c3e8e6653ef352301c40b5 -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.IO/StabilityStoneCoverConfigurationExporter.cs (.../StabilityStoneCoverConfigurationExporter.cs) (revision 633aedbd4c882f2811c3e8e6653ef352301c40b5) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.IO/StabilityStoneCoverConfigurationExporter.cs (.../StabilityStoneCoverConfigurationExporter.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Collections.Generic; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.IO.Exporters; using Ringtoets.StabilityStoneCover.Data; @@ -35,11 +36,11 @@ /// /// Creates a new instance of . /// - /// The calculation group to export. + /// The configuration to export. /// The path of the XML file to export to. - /// Thrown when is null. + /// Thrown when is null. /// Thrown when is invalid. - public StabilityStoneCoverConfigurationExporter(CalculationGroup calculationGroup, string filePath) - : base(calculationGroup, filePath) {} + public StabilityStoneCoverConfigurationExporter(IEnumerable configuration, string filePath) + : base(configuration, filePath) {} } } \ No newline at end of file Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs =================================================================== diff -u -rd04efd93e668625dd987f6987e8273fc613a2f21 -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision d04efd93e668625dd987f6987e8273fc613a2f21) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -166,7 +166,7 @@ yield return new ExportInfo { Name = RingtoetsCommonFormsResources.ConfigurationExporter_DisplayName, - CreateFileExporter = (context, filePath) => new StabilityStoneCoverConfigurationExporter(context.WrappedData, filePath), + CreateFileExporter = (context, filePath) => new StabilityStoneCoverConfigurationExporter(context.WrappedData.Children, filePath), IsEnabled = context => context.WrappedData.Children.Any(), FileFilterGenerator = new FileFilterGenerator( RingtoetsCommonFormsResources.DataTypeDisplayName_xml_file_filter_Extension, Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.IO.Test/StabilityStoneCoverConfigurationExporterTest.cs =================================================================== diff -u -r633aedbd4c882f2811c3e8e6653ef352301c40b5 -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.IO.Test/StabilityStoneCoverConfigurationExporterTest.cs (.../StabilityStoneCoverConfigurationExporterTest.cs) (revision 633aedbd4c882f2811c3e8e6653ef352301c40b5) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.IO.Test/StabilityStoneCoverConfigurationExporterTest.cs (.../StabilityStoneCoverConfigurationExporterTest.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -20,6 +20,7 @@ // All rights reserved. using System.IO; +using System.Linq; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Calculation; @@ -37,7 +38,7 @@ public void Constructor_ExpectedValues() { // Call - var exporter = new StabilityStoneCoverConfigurationExporter(new CalculationGroup(), "test.xml"); + var exporter = new StabilityStoneCoverConfigurationExporter(Enumerable.Empty(), "test.xml"); // Assert Assert.IsInstanceOf< @@ -88,16 +89,11 @@ } }; - var rootGroup = new CalculationGroup("root", false) + var exporter = new StabilityStoneCoverConfigurationExporter(new [] { - Children = - { - calculationGroup - } - }; + calculationGroup + }, filePath); - var exporter = new StabilityStoneCoverConfigurationExporter(rootGroup, filePath); - try { // Call Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.IO/WaveImpactAsphaltCoverConfigurationExporter.cs =================================================================== diff -u -r7348fb685e44d6eb4abf2854c8298c0a2189d67e -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.IO/WaveImpactAsphaltCoverConfigurationExporter.cs (.../WaveImpactAsphaltCoverConfigurationExporter.cs) (revision 7348fb685e44d6eb4abf2854c8298c0a2189d67e) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.IO/WaveImpactAsphaltCoverConfigurationExporter.cs (.../WaveImpactAsphaltCoverConfigurationExporter.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Collections.Generic; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.IO.Exporters; using Ringtoets.WaveImpactAsphaltCover.Data; @@ -35,11 +36,11 @@ /// /// Creates a new instance of . /// - /// The calculation group to export. + /// The configuration to export. /// The path of the XML file to export to. - /// Thrown when is null. + /// Thrown when is null. /// Thrown when is invalid. - public WaveImpactAsphaltCoverConfigurationExporter(CalculationGroup calculationGroup, string filePath) - : base(calculationGroup, filePath) {} + public WaveImpactAsphaltCoverConfigurationExporter(IEnumerable configuration, string filePath) + : base(configuration, filePath) {} } } \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs =================================================================== diff -u -r7348fb685e44d6eb4abf2854c8298c0a2189d67e -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision 7348fb685e44d6eb4abf2854c8298c0a2189d67e) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -171,7 +171,7 @@ Name = RingtoetsCommonFormsResources.ConfigurationExporter_DisplayName, CreateFileExporter = (context, filePath) => { - return new WaveImpactAsphaltCoverConfigurationExporter(context.WrappedData, filePath); + return new WaveImpactAsphaltCoverConfigurationExporter(context.WrappedData.Children, filePath); }, IsEnabled = context => context.WrappedData.Children.Any(), FileFilterGenerator = new FileFilterGenerator(RingtoetsCommonFormsResources.DataTypeDisplayName_xml_file_filter_Extension, Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.IO.Test/WaveImpactAsphaltCoverConfigurationExporterTest.cs =================================================================== diff -u -r7348fb685e44d6eb4abf2854c8298c0a2189d67e -r00a4b6318d0d1ae57df5ef362ba1e8908aa330be --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.IO.Test/WaveImpactAsphaltCoverConfigurationExporterTest.cs (.../WaveImpactAsphaltCoverConfigurationExporterTest.cs) (revision 7348fb685e44d6eb4abf2854c8298c0a2189d67e) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.IO.Test/WaveImpactAsphaltCoverConfigurationExporterTest.cs (.../WaveImpactAsphaltCoverConfigurationExporterTest.cs) (revision 00a4b6318d0d1ae57df5ef362ba1e8908aa330be) @@ -20,6 +20,7 @@ // All rights reserved. using System.IO; +using System.Linq; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Calculation; @@ -37,7 +38,7 @@ public void Constructor_ExpectedValues() { // Call - var exporter = new WaveImpactAsphaltCoverConfigurationExporter(new CalculationGroup(), "test.xml"); + var exporter = new WaveImpactAsphaltCoverConfigurationExporter(Enumerable.Empty(), "test.xml"); // Assert Assert.IsInstanceOf< @@ -88,16 +89,11 @@ } }; - var rootGroup = new CalculationGroup("root", false) + var exporter = new WaveImpactAsphaltCoverConfigurationExporter(new [] { - Children = - { - calculationGroup - } - }; + calculationGroup + }, filePath); - var exporter = new WaveImpactAsphaltCoverConfigurationExporter(rootGroup, filePath); - try { // Call