Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs =================================================================== diff -u -r1c9b0e9cabaad22335799a442889c63bfc651e59 -r654b96e16ce328f8eac1cc446eb1e3f8e4eb8798 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision 1c9b0e9cabaad22335799a442889c63bfc651e59) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision 654b96e16ce328f8eac1cc446eb1e3f8e4eb8798) @@ -79,11 +79,7 @@ AddEntityForHydraulicDatabase(section, entity, registry); AddEntityForReferenceLine(section, entity); - BackgroundDataEntity backgroundDataEntity = section.BackgroundData.Create(); - if (backgroundDataEntity != null) - { - entity.BackgroundDataEntities.Add(backgroundDataEntity); - } + entity.BackgroundDataEntities.Add(section.BackgroundData.Create()); entity.FailureMechanismEntities.Add(section.PipingFailureMechanism.Create(registry)); entity.FailureMechanismEntities.Add(section.GrassCoverErosionInwards.Create(registry)); Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/BackgroundDataCreateExtensions.cs =================================================================== diff -u -r2865b0fc522e96a2f12c47f29805b13259ecde4f -r654b96e16ce328f8eac1cc446eb1e3f8e4eb8798 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/BackgroundDataCreateExtensions.cs (.../BackgroundDataCreateExtensions.cs) (revision 2865b0fc522e96a2f12c47f29805b13259ecde4f) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/BackgroundDataCreateExtensions.cs (.../BackgroundDataCreateExtensions.cs) (revision 654b96e16ce328f8eac1cc446eb1e3f8e4eb8798) @@ -51,7 +51,8 @@ Name = backgroundData.Name.DeepClone(), IsVisible = Convert.ToByte(backgroundData.IsVisible), Transparency = backgroundData.Transparency, - BackgroundDataType = Convert.ToByte(backgroundData.BackgroundMapDataType) + BackgroundDataType = Convert.ToByte(backgroundData.BackgroundMapDataType), + IsConfigured = Convert.ToByte(backgroundData.IsConfigured) }; if (backgroundData.IsConfigured) Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs =================================================================== diff -u -r40793165416093e9d2fefb6b12acf82fbd8a84c2 -r654b96e16ce328f8eac1cc446eb1e3f8e4eb8798 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs (.../AssessmentSectionCreateExtensionsTest.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs (.../AssessmentSectionCreateExtensionsTest.cs) (revision 654b96e16ce328f8eac1cc446eb1e3f8e4eb8798) @@ -69,6 +69,8 @@ const string mapDataName = "map data name"; const double transparency = 0.3; const bool isVisible = true; + const bool isConfigured = true; + const BackgroundMapDataType backgroundType = BackgroundMapDataType.Wmts; var assessmentSection = new AssessmentSection(assessmentSectionComposition) { Id = testId, @@ -85,7 +87,9 @@ { Name = mapDataName, Transparency = (RoundedDouble) transparency, - IsVisible = isVisible + IsVisible = isVisible, + IsConfigured = isConfigured, + BackgroundMapDataType = backgroundType } }; var registry = new PersistenceRegistry(); @@ -133,6 +137,8 @@ Assert.AreEqual(mapDataName, backgroundMapDataEntity.Name); Assert.AreEqual(transparency, backgroundMapDataEntity.Transparency); Assert.AreEqual(Convert.ToByte(isVisible), backgroundMapDataEntity.IsVisible); + Assert.AreEqual(Convert.ToByte(isConfigured), backgroundMapDataEntity.IsConfigured); + Assert.AreEqual(Convert.ToByte(backgroundType), backgroundMapDataEntity.BackgroundDataType); CollectionAssert.IsEmpty(backgroundMapDataEntity.BackgroundDataMetaEntities); } Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/BackgroundDataCreateExtensionsTest.cs =================================================================== diff -u -r2865b0fc522e96a2f12c47f29805b13259ecde4f -r654b96e16ce328f8eac1cc446eb1e3f8e4eb8798 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/BackgroundDataCreateExtensionsTest.cs (.../BackgroundDataCreateExtensionsTest.cs) (revision 2865b0fc522e96a2f12c47f29805b13259ecde4f) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/BackgroundDataCreateExtensionsTest.cs (.../BackgroundDataCreateExtensionsTest.cs) (revision 654b96e16ce328f8eac1cc446eb1e3f8e4eb8798) @@ -20,6 +20,8 @@ // All rights reserved. using System; +using System.Collections.Generic; +using System.Linq; using Application.Ringtoets.Storage.Create; using Application.Ringtoets.Storage.DbContext; using Core.Common.Base.Data; @@ -82,25 +84,16 @@ Assert.AreEqual(Convert.ToByte(isVisible), entity.IsVisible); Assert.AreEqual(transparancy, entity.Transparency); Assert.AreEqual(Convert.ToByte(backgroundDataType), entity.BackgroundDataType); + Assert.AreEqual(Convert.ToByte(isConfigured), entity.IsConfigured); if (isConfigured) { Assert.AreEqual(3, entity.BackgroundDataMetaEntities.Count); - foreach (BackgroundDataMetaEntity backgroundDataMetaEntity in entity.BackgroundDataMetaEntities) + foreach (KeyValuePair parameter in backgroundData.Parameters) { - if (backgroundDataMetaEntity.Key == BackgroundDataIdentifiers.SourceCapabilitiesUrl) - { - Assert.AreEqual(sourceCapabilitiesUrl, backgroundDataMetaEntity.Value); - } - else if (backgroundDataMetaEntity.Key == BackgroundDataIdentifiers.SelectedCapabilityIdentifier) - { - Assert.AreEqual(selectedCapabilityName, backgroundDataMetaEntity.Value); - } - else if (backgroundDataMetaEntity.Key == BackgroundDataIdentifiers.PreferredFormat) - { - Assert.AreEqual(preferredFormat, backgroundDataMetaEntity.Value); - } + BackgroundDataMetaEntity backgroundDataMetaEntity = entity.BackgroundDataMetaEntities.Single(e => e.Key.Equals(parameter.Key)); + Assert.AreEqual(parameter.Value, backgroundDataMetaEntity.Value); } } else