Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/CombinedFailureMechanismSectionAssemblyResult.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Data/CombinedFailureMechanismSectionAssemblyResult.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/CombinedFailureMechanismSectionAssemblyResult.cs (revision 092446a2a287098fe2fdd448f662a60cf6d42f89) @@ -0,0 +1,302 @@ +// 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Ringtoets.AssemblyTool.Data; + +namespace Ringtoets.Integration.Data +{ + /// + /// Assembly result for the combined failure mechanism section. + /// + public class CombinedFailureMechanismSectionAssemblyResult + { + /// + /// Creates a new instance of . + /// + /// The start of the section from the beginning of the reference line. + /// The end of the section from the beginning of the reference line. + /// The total result of the section. + /// The container of the properties for the + /// . + /// Thrown when + /// is null. + public CombinedFailureMechanismSectionAssemblyResult(double sectionStart, double sectionEnd, + FailureMechanismSectionAssemblyCategoryGroup totalResult, + ConstructionProperties properties) + { + if (properties == null) + { + throw new ArgumentNullException(nameof(properties)); + } + + SectionStart = sectionStart; + SectionEnd = sectionEnd; + TotalResult = totalResult; + Piping = properties.Piping; + GrassCoverErosionInwards = properties.GrassCoverErosionInwards; + MacroStabilityInwards = properties.MacroStabilityInwards; + MacroStabilityOutwards = properties.MacroStabilityOutwards; + Microstability = properties.Microstability; + StabilityStoneCover = properties.StabilityStoneCover; + WaveImpactAsphaltCover = properties.WaveImpactAsphaltCover; + WaterPressureAsphaltCover = properties.WaterPressureAsphaltCover; + GrassCoverErosionOutwards = properties.GrassCoverErosionOutwards; + GrassCoverSlipOffOutwards = properties.GrassCoverSlipOffOutwards; + GrassCoverSlipOffInwards = properties.GrassCoverSlipOffInwards; + HeightStructures = properties.HeightStructures; + ClosingStructures = properties.ClosingStructures; + PipingStructures = properties.PipingStructures; + StabilityPointStructures = properties.StabilityPointStructures; + StrengthStabilityLengthwise = properties.StrengthStabilityLengthwise; + DuneErosion = properties.DuneErosion; + TechnicalInnovation = properties.TechnicalInnovation; + } + + /// + /// Gets the start of the section from the beginning of the reference line. + /// [m] + /// + public double SectionStart { get; } + + /// + /// Gets the end of the section from the beginning of the reference line. + /// [m] + /// + public double SectionEnd { get; } + + /// + /// Gets the total assembly result. + /// + public FailureMechanismSectionAssemblyCategoryGroup TotalResult { get; } + + /// + /// Gets the assembly result for piping. + /// + public FailureMechanismSectionAssemblyCategoryGroup Piping { get; } + + /// + /// Gets the assembly result for grass cover erosion inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverErosionInwards { get; } + + /// + /// Gets the assembly result for macro stability inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup MacroStabilityInwards { get; } + + /// + /// Gets the assembly result for macro stability outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup MacroStabilityOutwards { get; } + + /// + /// Gets the assembly result for microstability. + /// + public FailureMechanismSectionAssemblyCategoryGroup Microstability { get; } + + /// + /// Gets the assembly result for stability stone cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup StabilityStoneCover { get; } + + /// + /// Gets the assembly result for wave impact asphalt cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup WaveImpactAsphaltCover { get; } + + /// + /// Gets the assembly result for water pressure asphalt cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup WaterPressureAsphaltCover { get; } + + /// + /// Gets the assembly result for grass cover erosion outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverErosionOutwards { get; } + + /// + /// Gets the assembly result for grass cover slip off outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverSlipOffOutwards { get; } + + /// + /// Gets the assembly result for grass cover slip off inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverSlipOffInwards { get; } + + /// + /// Gets the assembly result for height structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup HeightStructures { get; } + + /// + /// Gets the assembly result for closing structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup ClosingStructures { get; } + + /// + /// Gets the assembly result for piping structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup PipingStructures { get; } + + /// + /// Gets the assembly result for stability point structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup StabilityPointStructures { get; } + + /// + /// Gets the assembly result for strength stability lengthwise. + /// + public FailureMechanismSectionAssemblyCategoryGroup StrengthStabilityLengthwise { get; } + + /// + /// Gets the assembly result for dune erosion. + /// + public FailureMechanismSectionAssemblyCategoryGroup DuneErosion { get; } + + /// + /// Gets the assembly result for technical innovation. + /// + public FailureMechanismSectionAssemblyCategoryGroup TechnicalInnovation { get; } + + /// + /// Container for properties for constructing a . + /// s + public class ConstructionProperties + { + /// + /// Creates a new instance of . + /// + public ConstructionProperties() + { + Piping = FailureMechanismSectionAssemblyCategoryGroup.None; + GrassCoverErosionInwards = FailureMechanismSectionAssemblyCategoryGroup.None; + MacroStabilityInwards = FailureMechanismSectionAssemblyCategoryGroup.None; + MacroStabilityOutwards = FailureMechanismSectionAssemblyCategoryGroup.None; + Microstability = FailureMechanismSectionAssemblyCategoryGroup.None; + StabilityStoneCover = FailureMechanismSectionAssemblyCategoryGroup.None; + WaveImpactAsphaltCover = FailureMechanismSectionAssemblyCategoryGroup.None; + WaterPressureAsphaltCover = FailureMechanismSectionAssemblyCategoryGroup.None; + GrassCoverErosionOutwards = FailureMechanismSectionAssemblyCategoryGroup.None; + GrassCoverSlipOffOutwards = FailureMechanismSectionAssemblyCategoryGroup.None; + GrassCoverSlipOffInwards = FailureMechanismSectionAssemblyCategoryGroup.None; + HeightStructures = FailureMechanismSectionAssemblyCategoryGroup.None; + ClosingStructures = FailureMechanismSectionAssemblyCategoryGroup.None; + PipingStructures = FailureMechanismSectionAssemblyCategoryGroup.None; + StabilityPointStructures = FailureMechanismSectionAssemblyCategoryGroup.None; + StrengthStabilityLengthwise = FailureMechanismSectionAssemblyCategoryGroup.None; + DuneErosion = FailureMechanismSectionAssemblyCategoryGroup.None; + TechnicalInnovation = FailureMechanismSectionAssemblyCategoryGroup.None; + } + + /// + /// Gets or sets the assembly result for piping. + /// + public FailureMechanismSectionAssemblyCategoryGroup Piping { internal get; set; } + + /// + /// Gets or sets the assembly result for grass cover erosion inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverErosionInwards { internal get; set; } + + /// + /// Gets or sets the assembly result for macro stability inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup MacroStabilityInwards { internal get; set; } + + /// + /// Gets or sets the assembly result for macro stability outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup MacroStabilityOutwards { internal get; set; } + + /// + /// Gets or sets the assembly result for microstability. + /// + public FailureMechanismSectionAssemblyCategoryGroup Microstability { internal get; set; } + + /// + /// Gets or sets the assembly result for stability stone cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup StabilityStoneCover { internal get; set; } + + /// + /// Gets or sets the assembly result for wave impact asphalt cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup WaveImpactAsphaltCover { internal get; set; } + + /// + /// Gets or sets the assembly result for water pressure asphalt cover. + /// + public FailureMechanismSectionAssemblyCategoryGroup WaterPressureAsphaltCover { internal get; set; } + + /// + /// Gets or sets the assembly result for grass cover erosion outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverErosionOutwards { internal get; set; } + + /// + /// Gets or sets the assembly result for grass cover slip off outwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverSlipOffOutwards { internal get; set; } + + /// + /// Gets or sets the assembly result for grass cover slip off inwards. + /// + public FailureMechanismSectionAssemblyCategoryGroup GrassCoverSlipOffInwards { internal get; set; } + + /// + /// Gets or sets the assembly result for height structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup HeightStructures { internal get; set; } + + /// + /// Gets or sets the assembly result for closing structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup ClosingStructures { internal get; set; } + + /// + /// Gets or sets the assembly result for piping structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup PipingStructures { internal get; set; } + + /// + /// Gets or sets the assembly result for stability point structures. + /// + public FailureMechanismSectionAssemblyCategoryGroup StabilityPointStructures { internal get; set; } + + /// + /// Gets or sets the assembly result for strength stability lengthwise. + /// + public FailureMechanismSectionAssemblyCategoryGroup StrengthStabilityLengthwise { internal get; set; } + + /// + /// Gets or sets the assembly result for dune erosion. + /// + public FailureMechanismSectionAssemblyCategoryGroup DuneErosion { internal get; set; } + + /// + /// Gets or sets the assembly result for technical innovation. + /// + public FailureMechanismSectionAssemblyCategoryGroup TechnicalInnovation { internal get; set; } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Data/Ringtoets.Integration.Data.csproj =================================================================== diff -u -rf15874e4f7121382aa524339b7fc37eadd92d7aa -r092446a2a287098fe2fdd448f662a60cf6d42f89 --- Ringtoets/Integration/src/Ringtoets.Integration.Data/Ringtoets.Integration.Data.csproj (.../Ringtoets.Integration.Data.csproj) (revision f15874e4f7121382aa524339b7fc37eadd92d7aa) +++ Ringtoets/Integration/src/Ringtoets.Integration.Data/Ringtoets.Integration.Data.csproj (.../Ringtoets.Integration.Data.csproj) (revision 092446a2a287098fe2fdd448f662a60cf6d42f89) @@ -13,6 +13,7 @@ + Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/CombinedFailureMechanismSectionAssemblyResultTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/CombinedFailureMechanismSectionAssemblyResultTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/CombinedFailureMechanismSectionAssemblyResultTest.cs (revision 092446a2a287098fe2fdd448f662a60cf6d42f89) @@ -0,0 +1,159 @@ +// 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 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.AssemblyTool.Data; + +namespace Ringtoets.Integration.Data.Test +{ + [TestFixture] + public class CombinedFailureMechanismSectionAssemblyResultTest + { + [Test] + public void Constructor_PropertiesNull_ThrowsArgumentNullException() + { + // Setup + var random = new Random(21); + + // Call + TestDelegate call = () => new CombinedFailureMechanismSectionAssemblyResult(random.NextDouble(), random.NextDouble(), + random.NextEnumValue(), null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("properties", exception.ParamName); + } + + [Test] + public void Constructor_WithEmptyConstructionProperties_ExpectedValues() + { + // Setup + var random = new Random(21); + double sectionStart = random.NextDouble(); + double sectionEnd = random.NextDouble(); + var totalResult = random.NextEnumValue(); + + // Call + var result = new CombinedFailureMechanismSectionAssemblyResult(sectionStart, sectionEnd, totalResult, + new CombinedFailureMechanismSectionAssemblyResult.ConstructionProperties()); + + // Assert + Assert.AreEqual(sectionStart, result.SectionStart); + Assert.AreEqual(sectionEnd, result.SectionEnd); + Assert.AreEqual(totalResult, result.TotalResult); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.Piping); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.GrassCoverErosionInwards); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.MacroStabilityInwards); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.MacroStabilityOutwards); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.Microstability); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.StabilityStoneCover); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.WaveImpactAsphaltCover); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.WaterPressureAsphaltCover); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.GrassCoverErosionOutwards); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.GrassCoverSlipOffOutwards); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.GrassCoverSlipOffInwards); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.HeightStructures); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.ClosingStructures); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.PipingStructures); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.StabilityPointStructures); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.StrengthStabilityLengthwise); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.DuneErosion); + Assert.AreEqual(FailureMechanismSectionAssemblyCategoryGroup.None, result.TechnicalInnovation); + } + + [Test] + public void Constructor_WithConstructionProperties_ExpectedValues() + { + // Setup + var random = new Random(21); + double sectionStart = random.NextDouble(); + double sectionEnd = random.NextDouble(); + var totalResult = random.NextEnumValue(); + var pipingResult = random.NextEnumValue(); + var grassCoverErosionInwardsResult = random.NextEnumValue(); + var macroStabilityInwardsResult = random.NextEnumValue(); + var macroStabilityOutwardsResult = random.NextEnumValue(); + var microstabilityResult = random.NextEnumValue(); + var stabilityStoneCoverResult = random.NextEnumValue(); + var waveImpactAsphaltCoverResult = random.NextEnumValue(); + var waterPressureAsphaltCoverResult = random.NextEnumValue(); + var grassCoverErosionOutwardsResult = random.NextEnumValue(); + var grassCoverSlipOffOutwardsResult = random.NextEnumValue(); + var grassCoverSlipOffInwardsResult = random.NextEnumValue(); + var heightStructuresResult = random.NextEnumValue(); + var closingStructuresResult = random.NextEnumValue(); + var pipingStructuresResult = random.NextEnumValue(); + var stabilityPointStructuresResult = random.NextEnumValue(); + var strengthStabilityLengthwiseResult = random.NextEnumValue(); + var duneErosionResult = random.NextEnumValue(); + var technicalInnovationResult = random.NextEnumValue(); + + // Call + var result = new CombinedFailureMechanismSectionAssemblyResult(sectionStart, sectionEnd, totalResult, + new CombinedFailureMechanismSectionAssemblyResult.ConstructionProperties + { + Piping = pipingResult, + GrassCoverErosionInwards = grassCoverErosionInwardsResult, + MacroStabilityInwards = macroStabilityInwardsResult, + MacroStabilityOutwards = macroStabilityOutwardsResult, + Microstability = microstabilityResult, + StabilityStoneCover = stabilityStoneCoverResult, + WaveImpactAsphaltCover = waveImpactAsphaltCoverResult, + WaterPressureAsphaltCover = waterPressureAsphaltCoverResult, + GrassCoverErosionOutwards = grassCoverErosionOutwardsResult, + GrassCoverSlipOffOutwards = grassCoverSlipOffOutwardsResult, + GrassCoverSlipOffInwards = grassCoverSlipOffInwardsResult, + HeightStructures = heightStructuresResult, + ClosingStructures = closingStructuresResult, + PipingStructures = pipingStructuresResult, + StabilityPointStructures = stabilityPointStructuresResult, + StrengthStabilityLengthwise = strengthStabilityLengthwiseResult, + DuneErosion = duneErosionResult, + TechnicalInnovation = technicalInnovationResult + }); + + // Assert + Assert.AreEqual(sectionStart, result.SectionStart); + Assert.AreEqual(sectionEnd, result.SectionEnd); + Assert.AreEqual(totalResult, result.TotalResult); + Assert.AreEqual(pipingResult, result.Piping); + Assert.AreEqual(grassCoverErosionInwardsResult, result.GrassCoverErosionInwards); + Assert.AreEqual(macroStabilityInwardsResult, result.MacroStabilityInwards); + Assert.AreEqual(macroStabilityOutwardsResult, result.MacroStabilityOutwards); + Assert.AreEqual(microstabilityResult, result.Microstability); + Assert.AreEqual(stabilityStoneCoverResult, result.StabilityStoneCover); + Assert.AreEqual(waveImpactAsphaltCoverResult, result.WaveImpactAsphaltCover); + Assert.AreEqual(waterPressureAsphaltCoverResult, result.WaterPressureAsphaltCover); + Assert.AreEqual(grassCoverErosionOutwardsResult, result.GrassCoverErosionOutwards); + Assert.AreEqual(grassCoverSlipOffOutwardsResult, result.GrassCoverSlipOffOutwards); + Assert.AreEqual(grassCoverSlipOffInwardsResult, result.GrassCoverSlipOffInwards); + Assert.AreEqual(heightStructuresResult, result.HeightStructures); + Assert.AreEqual(closingStructuresResult, result.ClosingStructures); + Assert.AreEqual(pipingStructuresResult, result.PipingStructures); + Assert.AreEqual(stabilityPointStructuresResult, result.StabilityPointStructures); + Assert.AreEqual(strengthStabilityLengthwiseResult, result.StrengthStabilityLengthwise); + Assert.AreEqual(duneErosionResult, result.DuneErosion); + Assert.AreEqual(technicalInnovationResult, result.TechnicalInnovation); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/Ringtoets.Integration.Data.Test.csproj =================================================================== diff -u -rf15874e4f7121382aa524339b7fc37eadd92d7aa -r092446a2a287098fe2fdd448f662a60cf6d42f89 --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/Ringtoets.Integration.Data.Test.csproj (.../Ringtoets.Integration.Data.Test.csproj) (revision f15874e4f7121382aa524339b7fc37eadd92d7aa) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/Ringtoets.Integration.Data.Test.csproj (.../Ringtoets.Integration.Data.Test.csproj) (revision 092446a2a287098fe2fdd448f662a60cf6d42f89) @@ -20,6 +20,7 @@ +