Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensionsTest.cs =================================================================== diff -u -r802d3cd39b925ac9873ea277588ecd1933e374f6 -r27963fc53c323c7a6b6382bee7d1ded31b6ac3a0 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensionsTest.cs (.../StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensionsTest.cs) (revision 802d3cd39b925ac9873ea277588ecd1933e374f6) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensionsTest.cs (.../StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensionsTest.cs) (revision 27963fc53c323c7a6b6382bee7d1ded31b6ac3a0) @@ -25,7 +25,8 @@ using Application.Ringtoets.Storage.TestUtil; using Core.Common.TestUtil; using NUnit.Framework; -using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.AssemblyTool.Data; +using Ringtoets.Common.Primitives; using Ringtoets.Integration.Data.StandAlone.SectionResults; namespace Application.Ringtoets.Storage.Test.Read @@ -34,9 +35,23 @@ public class StrengthStabilityLengthwiseConstructionSectionResultEntityReadExtensionsTest { [Test] - public void Read_SectionResultIsNull_ThrowArgumentNullException() + public void Read_EntityNull_ThrowsArgumentNullException() { // Setup + var sectionResult = new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(new TestFailureMechanismSection()); + + // Call + TestDelegate test = () => ((StrengthStabilityLengthwiseConstructionSectionResultEntity) null).Read(sectionResult); + + // Assert + var exception = Assert.Throws(test); + Assert.AreEqual("entity", exception.ParamName); + } + + [Test] + public void Read_SectionResultNull_ThrowsArgumentNullException() + { + // Setup var entity = new StrengthStabilityLengthwiseConstructionSectionResultEntity(); // Call @@ -48,31 +63,32 @@ } [Test] - public void Read_ParameterValues_SectionResultWithParameterValues() + public void Read_ParameterValues_SetsSectionResultWithParameterValues() { // Setup - var random = new Random(21); - var layerOne = random.NextEnumValue(); - double layerThree = random.NextDouble(); + var random = new Random(31); + var simpleAssessmentResult = random.NextEnumValue(); + var tailorMadeAssessmentResult = random.NextEnumValue(); + var manualAssemblyCategoryGroup = random.NextEnumValue(); + bool useManualAssemblyCategoryGroup = random.NextBoolean(); - var collector = new ReadConversionCollector(); - - var failureMechanismSectionEntity = new FailureMechanismSectionEntity(); - collector.Read(failureMechanismSectionEntity, new TestFailureMechanismSection()); var entity = new StrengthStabilityLengthwiseConstructionSectionResultEntity { - LayerThree = layerThree, - LayerOne = Convert.ToByte(layerOne), - FailureMechanismSectionEntity = failureMechanismSectionEntity + SimpleAssessmentResult = Convert.ToByte(simpleAssessmentResult), + TailorMadeAssessmentResult = Convert.ToByte(tailorMadeAssessmentResult), + UseManualAssemblyCategoryGroup = Convert.ToByte(useManualAssemblyCategoryGroup), + ManualAssemblyCategoryGroup = Convert.ToByte(manualAssemblyCategoryGroup) }; var sectionResult = new StrengthStabilityLengthwiseConstructionFailureMechanismSectionResult(new TestFailureMechanismSection()); // Call entity.Read(sectionResult); // Assert - Assert.IsNotNull(sectionResult); - Assert.AreEqual(layerOne, sectionResult.AssessmentLayerOne); + Assert.AreEqual(simpleAssessmentResult, sectionResult.SimpleAssessmentResult); + Assert.AreEqual(tailorMadeAssessmentResult, sectionResult.TailorMadeAssessmentResult); + Assert.AreEqual(useManualAssemblyCategoryGroup, sectionResult.UseManualAssemblyCategoryGroup); + Assert.AreEqual(manualAssemblyCategoryGroup, sectionResult.ManualAssemblyCategoryGroup); } } } \ No newline at end of file