Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs =================================================================== diff -u -rfd239437a5e3081222a0801b48ff4c50e5cd68d4 -r567010ec26005f9215844b88c139774de74c2daa --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision fd239437a5e3081222a0801b48ff4c50e5cd68d4) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision 567010ec26005f9215844b88c139774de74c2daa) @@ -80,7 +80,7 @@ Order = order }; - AddEntityForHydraulicDatabase(section, entity, registry); + AddEntityForHydraulicDatabase(section.HydraulicBoundaryDatabase, entity, registry); AddEntityForReferenceLine(section, entity); entity.BackgroundDataEntities.Add(section.BackgroundData.Create()); @@ -115,25 +115,25 @@ } } - private static void AddEntityForHydraulicDatabase(AssessmentSection section, AssessmentSectionEntity entity, PersistenceRegistry registry) + private static void AddEntityForHydraulicDatabase(HydraulicBoundaryDatabase hydraulicBoundaryDatabase, AssessmentSectionEntity entity, PersistenceRegistry registry) { - if (section.HydraulicBoundaryDatabase.IsCoupled()) + if (hydraulicBoundaryDatabase.IsCoupled()) { - entity.HydraulicDatabaseLocation = section.HydraulicBoundaryDatabase.FilePath.DeepClone(); - entity.HydraulicDatabaseVersion = section.HydraulicBoundaryDatabase.Version.DeepClone(); + entity.HydraulicDatabaseLocation = hydraulicBoundaryDatabase.FilePath.DeepClone(); + entity.HydraulicDatabaseVersion = hydraulicBoundaryDatabase.Version.DeepClone(); - if (section.HydraulicBoundaryDatabase.CanUsePreprocessor) + if (hydraulicBoundaryDatabase.CanUsePreprocessor) { entity.HydraRingPreprocessorEntities.Add(new HydraRingPreprocessorEntity { - UsePreprocessor = Convert.ToByte(section.HydraulicBoundaryDatabase.UsePreprocessor), - PreprocessorDirectory = section.HydraulicBoundaryDatabase.PreprocessorDirectory.DeepClone() + UsePreprocessor = Convert.ToByte(hydraulicBoundaryDatabase.UsePreprocessor), + PreprocessorDirectory = hydraulicBoundaryDatabase.PreprocessorDirectory.DeepClone() }); } - for (var i = 0; i < section.HydraulicBoundaryDatabase.Locations.Count; i++) + for (var i = 0; i < hydraulicBoundaryDatabase.Locations.Count; i++) { - HydraulicBoundaryLocation hydraulicBoundaryLocation = section.HydraulicBoundaryDatabase.Locations[i]; + HydraulicBoundaryLocation hydraulicBoundaryLocation = hydraulicBoundaryDatabase.Locations[i]; entity.HydraulicLocationEntities.Add(hydraulicBoundaryLocation.Create(registry, i)); } } Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs =================================================================== diff -u -rfd239437a5e3081222a0801b48ff4c50e5cd68d4 -r567010ec26005f9215844b88c139774de74c2daa --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs (.../AssessmentSectionCreateExtensionsTest.cs) (revision fd239437a5e3081222a0801b48ff4c50e5cd68d4) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs (.../AssessmentSectionCreateExtensionsTest.cs) (revision 567010ec26005f9215844b88c139774de74c2daa) @@ -132,11 +132,6 @@ Assert.IsNotNull(entity.FailureMechanismEntities.SingleOrDefault(fme => fme.FailureMechanismType == (short) FailureMechanismType.TechnicalInnovations)); Assert.AreEqual(order, entity.Order); - Assert.IsNull(entity.HydraulicDatabaseLocation); - Assert.IsNull(entity.HydraulicDatabaseVersion); - CollectionAssert.IsEmpty(entity.HydraulicLocationEntities); - CollectionAssert.IsEmpty(entity.HydraRingPreprocessorEntities); - Assert.IsNull(entity.ReferenceLinePointXml); Assert.AreEqual(1, entity.BackgroundDataEntities.Count); @@ -185,9 +180,26 @@ } [Test] - public void Create_WithCanUsePreprocessorFalse_SetsPropertiesAndLocationsToEntity() + public void Create_HydraulicBoundaryDatabaseNotCoupled_SetsExpectedPropertiesToEntity() { // Setup + var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + var registry = new PersistenceRegistry(); + + // Call + AssessmentSectionEntity entity = assessmentSection.Create(registry, 0); + + // Assert + Assert.IsNull(entity.HydraulicDatabaseLocation); + Assert.IsNull(entity.HydraulicDatabaseVersion); + CollectionAssert.IsEmpty(entity.HydraulicLocationEntities); + CollectionAssert.IsEmpty(entity.HydraRingPreprocessorEntities); + } + + [Test] + public void Create_HydraulicBoundaryDatabaseCoupledWithCanUsePreprocessorFalse_SetsExpectedPropertiesToEntity() + { + // Setup const string testFilePath = "path"; const string testVersion = "1"; @@ -216,7 +228,7 @@ } [Test] - public void Create_WithCanUsePreprocessorTrue_SetsPropertiesAndLocationsToEntity() + public void Create_HydraulicBoundaryDatabaseCoupledWithCanUsePreprocessorTrue_SetsExpectedPropertiesToEntity() { // Setup const string testFilePath = "path"; Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/AssessmentSectionHelperTest.cs =================================================================== diff -u -r36c0a3c74a70ee0b90df04f69b121b50cfc6c814 -r567010ec26005f9215844b88c139774de74c2daa --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/AssessmentSectionHelperTest.cs (.../AssessmentSectionHelperTest.cs) (revision 36c0a3c74a70ee0b90df04f69b121b50cfc6c814) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/AssessmentSectionHelperTest.cs (.../AssessmentSectionHelperTest.cs) (revision 567010ec26005f9215844b88c139774de74c2daa) @@ -33,7 +33,7 @@ public class AssessmentSectionHelperTest { [Test] - public void CreateAssessmentSectionStub_WithoutFailureMechanimAndFilePath_ReturnsExpectedAssessmentSectionStub() + public void CreateAssessmentSectionStub_WithoutFailureMechanismAndFilePath_ReturnsExpectedAssessmentSectionStub() { // Setup var mocks = new MockRepository(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/RingtoetsProjectTest.cs =================================================================== diff -u -ra1abe798a3991d9fff01eae522ccae2a43d0a931 -r567010ec26005f9215844b88c139774de74c2daa --- Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/RingtoetsProjectTest.cs (.../RingtoetsProjectTest.cs) (revision a1abe798a3991d9fff01eae522ccae2a43d0a931) +++ Ringtoets/Integration/test/Ringtoets.Integration.Data.Test/RingtoetsProjectTest.cs (.../RingtoetsProjectTest.cs) (revision 567010ec26005f9215844b88c139774de74c2daa) @@ -147,9 +147,9 @@ .SetName("Description"); var random = new Random(21); - RingtoetsProject differentAsessmentSections = CreateProject(); - differentAsessmentSections.AssessmentSections.Add(new AssessmentSection(random.NextEnumValue())); - yield return new TestCaseData(differentAsessmentSections) + RingtoetsProject differentAssessmentSections = CreateProject(); + differentAssessmentSections.AssessmentSections.Add(new AssessmentSection(random.NextEnumValue())); + yield return new TestCaseData(differentAssessmentSections) .SetName("AssessmentSections"); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs =================================================================== diff -u -r66c2f121366073bd6f2944ee0d9c5ec664a4cd09 -r567010ec26005f9215844b88c139774de74c2daa --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 66c2f121366073bd6f2944ee0d9c5ec664a4cd09) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 567010ec26005f9215844b88c139774de74c2daa) @@ -585,7 +585,7 @@ } [Test] - [Apartment(ApartmentState.STA)] // Due to creating fluent Ribbon + [Apartment(ApartmentState.STA)] public void Activate_WithGui_ExpectedProperties() { // Setup Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsRibbonTest.cs =================================================================== diff -u -r1bbf51443c907b5f202e80764fa05f2e7f842c04 -r567010ec26005f9215844b88c139774de74c2daa --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsRibbonTest.cs (.../RingtoetsRibbonTest.cs) (revision 1bbf51443c907b5f202e80764fa05f2e7f842c04) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsRibbonTest.cs (.../RingtoetsRibbonTest.cs) (revision 567010ec26005f9215844b88c139774de74c2daa) @@ -33,7 +33,7 @@ public class RingtoetsRibbonTest { [Test] - [Apartment(ApartmentState.STA)] // Due to creating fluent Ribbon + [Apartment(ApartmentState.STA)] public void GetRibbonControl_Always_ReturnRibbon() { // Setup @@ -47,7 +47,7 @@ } [Test] - [Apartment(ApartmentState.STA)] // Due to creating fluent Ribbon + [Apartment(ApartmentState.STA)] public void AddAssessmentSectionButtonCommand_AddAssessmentSectionButtonClicked_ExecutesCommand() { // Setup Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/DataImportHelperTest.cs =================================================================== diff -u -rf485a39b1667b1450805bb0fad9f8d13c1b6e984 -r567010ec26005f9215844b88c139774de74c2daa --- Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/DataImportHelperTest.cs (.../DataImportHelperTest.cs) (revision f485a39b1667b1450805bb0fad9f8d13c1b6e984) +++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/DataImportHelperTest.cs (.../DataImportHelperTest.cs) (revision 567010ec26005f9215844b88c139774de74c2daa) @@ -41,7 +41,7 @@ } [Test] - public void ImportReferenceLine_AssesmentSectionNull_ThrowsArgumentNullException() + public void ImportReferenceLine_AssessmentSectionNull_ThrowsArgumentNullException() { // Call TestDelegate test = () => DataImportHelper.ImportReferenceLine(null); Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingPluginTest.cs =================================================================== diff -u -r09693d79085118c47709b7059ab7c1ef459ad2aa -r567010ec26005f9215844b88c139774de74c2daa --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingPluginTest.cs (.../PipingPluginTest.cs) (revision 09693d79085118c47709b7059ab7c1ef459ad2aa) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingPluginTest.cs (.../PipingPluginTest.cs) (revision 567010ec26005f9215844b88c139774de74c2daa) @@ -41,7 +41,7 @@ public class PipingPluginTest { [Test] - [Apartment(ApartmentState.STA)] // For creation of XAML UI component (PipingRibbon) + [Apartment(ApartmentState.STA)] public void DefaultConstructor_ExpectedValues() { // Call