Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj
===================================================================
diff -u -r258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj (.../Application.Ringtoets.Storage.csproj) (revision 258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Application.Ringtoets.Storage.csproj (.../Application.Ringtoets.Storage.csproj) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -85,9 +85,12 @@
RingtoetsEntities.tt
-
+
RingtoetsEntities.tt
+
+ RingtoetsEntities.tt
+
RingtoetsEntities.tt
@@ -296,6 +299,7 @@
RingtoetsEntities.tt
+
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs
===================================================================
diff -u -r258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision 258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/AssessmentSectionCreateExtensions.cs (.../AssessmentSectionCreateExtensions.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -79,10 +79,10 @@
AddEntityForHydraulicDatabase(section, entity, registry);
AddEntityForReferenceLine(section, entity);
- BackgroundMapDataEntity backgroundMapDataEntity = section.BackgroundData.Create();
+ BackgroundDataEntity backgroundMapDataEntity = section.BackgroundData.Create();
if (backgroundMapDataEntity != null)
{
- entity.BackgroundMapDataEntities.Add(backgroundMapDataEntity);
+ entity.BackgroundDataEntities.Add(backgroundMapDataEntity);
}
entity.FailureMechanismEntities.Add(section.PipingFailureMechanism.Create(registry));
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Create/BackgroundDataCreateExtensions.cs
===================================================================
diff -u -r258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Create/BackgroundDataCreateExtensions.cs (.../BackgroundDataCreateExtensions.cs) (revision 258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Create/BackgroundDataCreateExtensions.cs (.../BackgroundDataCreateExtensions.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using System.Collections.Generic;
using Application.Ringtoets.Storage.DbContext;
using Core.Common.Utils.Extensions;
using Ringtoets.Common.Data.AssessmentSection;
@@ -28,17 +29,17 @@
{
///
/// Extensions methods for related to
- /// creating a .
+ /// creating a .
///
internal static class BackgroundDataCreateExtensions
{
///
- /// Creates a based on the information of the
+ /// Creates a based on the information of the
/// .
///
- /// The container to create a for.
+ /// The container to create a for.
/// The entity, or null if is not supported.
- internal static BackgroundMapDataEntity Create(this BackgroundData backgroundData)
+ internal static BackgroundDataEntity Create(this BackgroundData backgroundData)
{
if (backgroundData == null)
{
@@ -52,9 +53,9 @@
return null; // TODO: WTI-1141
}
- private static BackgroundMapDataEntity CreateWithWmtsData(BackgroundData backgroundData)
+ private static BackgroundDataEntity CreateWithWmtsData(BackgroundData backgroundData)
{
- var entity = new BackgroundMapDataEntity
+ var entity = new BackgroundDataEntity
{
Name = backgroundData.Name.DeepClone(),
IsVisible = Convert.ToByte(backgroundData.IsVisible),
@@ -63,12 +64,24 @@
if (backgroundData.IsConfigured)
{
- entity.SelectedCapabilityName = backgroundData.Parameters[BackgroundDataIdentifiers.SelectedCapabilityIdentifier].DeepClone();
- entity.SourceCapabilitiesUrl = backgroundData.Parameters[BackgroundDataIdentifiers.SourceCapabilitiesUrl].DeepClone();
- entity.PreferredFormat = backgroundData.Parameters[BackgroundDataIdentifiers.PreferredFormat].DeepClone();
+ AddEntitiesForBackgroundDataMeta(backgroundData, entity);
}
return entity;
}
+
+ private static void AddEntitiesForBackgroundDataMeta(BackgroundData backgroundData, BackgroundDataEntity entity)
+ {
+ foreach (KeyValuePair backgroundDataParameter in backgroundData.Parameters)
+ {
+ var metaEntity = new BackgroundDataMetaEntity
+ {
+ Key = backgroundDataParameter.Key.DeepClone(),
+ Value = backgroundDataParameter.Value.DeepClone()
+ };
+
+ entity.BackgroundDataMetaEntities.Add(metaEntity);
+ }
+ }
}
}
\ No newline at end of file
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/AssessmentSectionEntity.cs
===================================================================
diff -u -r5e44a4eb7c69ccaca763dce7cd7735e33a1f3c85 -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/AssessmentSectionEntity.cs (.../AssessmentSectionEntity.cs) (revision 5e44a4eb7c69ccaca763dce7cd7735e33a1f3c85)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/AssessmentSectionEntity.cs (.../AssessmentSectionEntity.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -38,7 +38,7 @@
[SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public AssessmentSectionEntity()
{
- BackgroundMapDataEntities = new HashSet();
+ BackgroundDataEntities = new HashSet();
FailureMechanismEntities = new HashSet();
HydraulicLocationEntities = new HashSet();
}
@@ -58,7 +58,7 @@
public virtual ProjectEntity ProjectEntity { get; set; }
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
- public virtual ICollection BackgroundMapDataEntities { get; set; }
+ public virtual ICollection BackgroundDataEntities { get; set; }
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public virtual ICollection FailureMechanismEntities { get; set; }
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/BackgroundDataEntity.cs
===================================================================
diff -u
--- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/BackgroundDataEntity.cs (revision 0)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/BackgroundDataEntity.cs (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -0,0 +1,57 @@
+// Copyright (C) Stichting Deltares 2016. 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.
+
+//------------------------------------------------------------------------------
+//
+// This code was generated from a template.
+//
+// Manual changes to this file may cause unexpected behavior in your application.
+// Manual changes to this file will be overwritten if the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
+
+namespace Application.Ringtoets.Storage.DbContext
+{
+ public partial class BackgroundDataEntity
+ {
+ [SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
+ public BackgroundDataEntity()
+ {
+ BackgroundDataMetaEntities = new HashSet();
+ }
+
+ public long BackgroundDataEntityId { get; set; }
+ public long AssessmentSectionEntityId { get; set; }
+ public string Name { get; set; }
+ public byte IsVisible { get; set; }
+ public double Transparency { get; set; }
+ public byte IsConfigured { get; set; }
+ public byte BackgroundDataType { get; set; }
+
+ public virtual AssessmentSectionEntity AssessmentSectionEntity { get; set; }
+
+ [SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
+ public virtual ICollection BackgroundDataMetaEntities { get; set; }
+ }
+}
\ No newline at end of file
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/BackgroundDataMetaEntity.cs
===================================================================
diff -u
--- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/BackgroundDataMetaEntity.cs (revision 0)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/BackgroundDataMetaEntity.cs (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -0,0 +1,42 @@
+// Copyright (C) Stichting Deltares 2016. 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.
+
+//------------------------------------------------------------------------------
+//
+// This code was generated from a template.
+//
+// Manual changes to this file may cause unexpected behavior in your application.
+// Manual changes to this file will be overwritten if the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Application.Ringtoets.Storage.DbContext
+{
+ public partial class BackgroundDataMetaEntity
+ {
+ public long BackgroundDataMetaEntityId { get; set; }
+ public long BackgroundDataEntityId { get; set; }
+ public string Key { get; set; }
+ public string Value { get; set; }
+
+ public virtual BackgroundDataEntity BackgroundDataEntity { get; set; }
+ }
+}
\ No newline at end of file
Fisheye: Tag 40793165416093e9d2fefb6b12acf82fbd8a84c2 refers to a dead (removed) revision in file `Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/BackgroundMapDataEntity.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Context.cs
===================================================================
diff -u -r5e44a4eb7c69ccaca763dce7cd7735e33a1f3c85 -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Context.cs (.../RingtoetsEntities.Context.cs) (revision 5e44a4eb7c69ccaca763dce7cd7735e33a1f3c85)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.Context.cs (.../RingtoetsEntities.Context.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -36,7 +36,8 @@
public partial class RingtoetsEntities : System.Data.Entity.DbContext
{
public virtual DbSet AssessmentSectionEntities { get; set; }
- public virtual DbSet BackgroundMapDataEntities { get; set; }
+ public virtual DbSet BackgroundDataEntities { get; set; }
+ public virtual DbSet BackgroundDataMetaEntities { get; set; }
public virtual DbSet CalculationGroupEntities { get; set; }
public virtual DbSet CharacteristicPointEntities { get; set; }
public virtual DbSet ClosingStructureEntities { get; set; }
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx
===================================================================
diff -u -r873bd2b6b7b9d0737dde2ed16ff5d10a66795a2f -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx (.../RingtoetsEntities.edmx) (revision 873bd2b6b7b9d0737dde2ed16ff5d10a66795a2f)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx (.../RingtoetsEntities.edmx) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -4,7 +4,7 @@
-
+
@@ -21,19 +21,27 @@
-
+
-
+
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -1057,18 +1065,30 @@
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -2127,7 +2147,8 @@
-
+
+
@@ -2197,10 +2218,14 @@
-
+
-
+
+
+
+
+
@@ -2560,7 +2585,8 @@
-
+
+
@@ -2630,9 +2656,9 @@
-
+
-
+
@@ -2642,6 +2668,10 @@
+
+
+
+
@@ -3003,24 +3033,34 @@
-
+
-
+
-
+
-
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -4219,14 +4259,14 @@
-
+
-
+
-
+
@@ -4255,6 +4295,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
@@ -5310,20 +5362,29 @@
-
-
-
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram
===================================================================
diff -u -r873bd2b6b7b9d0737dde2ed16ff5d10a66795a2f -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram (.../RingtoetsEntities.edmx.diagram) (revision 873bd2b6b7b9d0737dde2ed16ff5d10a66795a2f)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/DbContext/RingtoetsEntities.edmx.diagram (.../RingtoetsEntities.edmx.diagram) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -6,76 +6,78 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
-
+
+
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/AssessmentSectionEntityReadExtensions.cs
===================================================================
diff -u -r258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/AssessmentSectionEntityReadExtensions.cs (.../AssessmentSectionEntityReadExtensions.cs) (revision 258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/AssessmentSectionEntityReadExtensions.cs (.../AssessmentSectionEntityReadExtensions.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -110,7 +110,7 @@
private static void ReadBackgroundMapData(this AssessmentSectionEntity entity, IAssessmentSection assessmentSection)
{
- BackgroundData backgroundData = entity.BackgroundMapDataEntities.Single().Read();
+ BackgroundData backgroundData = entity.BackgroundDataEntities.Single().Read();
assessmentSection.BackgroundData.IsVisible = backgroundData.IsVisible;
assessmentSection.BackgroundData.Transparency = backgroundData.Transparency;
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/BackgroundDataMetaEntityReadExtensions.cs
===================================================================
diff -u
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/BackgroundDataMetaEntityReadExtensions.cs (revision 0)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/BackgroundDataMetaEntityReadExtensions.cs (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -0,0 +1,52 @@
+// Copyright (C) Stichting Deltares 2016. 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 System.Collections.Generic;
+using Application.Ringtoets.Storage.DbContext;
+
+namespace Application.Ringtoets.Storage.Read
+{
+ ///
+ /// Extensions methods for read operations based on the .
+ ///
+ internal static class BackgroundDataMetaEntityReadExtensions
+ {
+ ///
+ /// Read the and use the information
+ /// to construct a .
+ ///
+ /// The
+ /// to create for.
+ /// A new .
+ /// Thrown when
+ /// is null.
+ internal static KeyValuePair Read(this BackgroundDataMetaEntity entity)
+ {
+ if (entity == null)
+ {
+ throw new ArgumentNullException(nameof(entity));
+ }
+
+ return new KeyValuePair(entity.Key, entity.Value);
+ }
+ }
+}
\ No newline at end of file
Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/BackgroundMapDataEntityReadExtensions.cs
===================================================================
diff -u -r258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/BackgroundMapDataEntityReadExtensions.cs (.../BackgroundMapDataEntityReadExtensions.cs) (revision 258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e)
+++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/BackgroundMapDataEntityReadExtensions.cs (.../BackgroundMapDataEntityReadExtensions.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using System.Collections.Generic;
using Application.Ringtoets.Storage.DbContext;
using Core.Common.Base.Data;
using Ringtoets.Common.Data.AssessmentSection;
@@ -28,20 +29,20 @@
{
///
/// Extension methods for read operations for
- /// based on the .
+ /// based on the .
///
internal static class BackgroundMapDataEntityReadExtensions
{
///
- /// Read the and use the information
+ /// Read the and use the information
/// to construct .
///
- /// The
+ /// The
/// to create for.
/// A new .
/// Thrown when
/// is null.
- internal static BackgroundData Read(this BackgroundMapDataEntity entity)
+ internal static BackgroundData Read(this BackgroundDataEntity entity)
{
if (entity == null)
{
@@ -52,19 +53,31 @@
{
IsVisible = Convert.ToBoolean(entity.IsVisible),
Transparency = (RoundedDouble) entity.Transparency,
- Name = entity.Name
+ Name = entity.Name,
+ IsConfigured = Convert.ToBoolean(entity.IsConfigured)
};
- if (entity.SourceCapabilitiesUrl != null && entity.SelectedCapabilityName != null && entity.PreferredFormat != null)
+ if (backgroundData.IsConfigured)
{
- backgroundData.Parameters[BackgroundDataIdentifiers.SourceCapabilitiesUrl] = entity.SourceCapabilitiesUrl;
- backgroundData.Parameters[BackgroundDataIdentifiers.SelectedCapabilityIdentifier] = entity.SelectedCapabilityName;
- backgroundData.Parameters[BackgroundDataIdentifiers.PreferredFormat] = entity.PreferredFormat;
+ foreach (BackgroundDataMetaEntity backgroundDataMetaEntity in entity.BackgroundDataMetaEntities)
+ {
+ KeyValuePair parameter = backgroundDataMetaEntity.Read();
- backgroundData.IsConfigured = true;
+ if (ValidKey(parameter.Key))
+ {
+ backgroundData.Parameters[parameter.Key] = parameter.Value;
+ }
+ }
}
return backgroundData;
}
+
+ private static bool ValidKey(string keyToValidate)
+ {
+ return keyToValidate == BackgroundDataIdentifiers.SourceCapabilitiesUrl
+ || keyToValidate == BackgroundDataIdentifiers.SelectedCapabilityIdentifier
+ || keyToValidate == BackgroundDataIdentifiers.PreferredFormat;
+ }
}
}
\ No newline at end of file
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj
===================================================================
diff -u -r258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision 258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -100,6 +100,7 @@
+
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs
===================================================================
diff -u -r258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs (.../AssessmentSectionCreateExtensionsTest.cs) (revision 258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/AssessmentSectionCreateExtensionsTest.cs (.../AssessmentSectionCreateExtensionsTest.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -127,15 +127,13 @@
Assert.IsNull(entity.ReferenceLinePointXml);
- Assert.AreEqual(1, entity.BackgroundMapDataEntities.Count);
- var backgroundMapDataEntity = entity.BackgroundMapDataEntities.Single();
+ Assert.AreEqual(1, entity.BackgroundDataEntities.Count);
+ var backgroundMapDataEntity = entity.BackgroundDataEntities.Single();
Assert.IsNotNull(backgroundMapDataEntity);
Assert.AreEqual(mapDataName, backgroundMapDataEntity.Name);
Assert.AreEqual(transparency, backgroundMapDataEntity.Transparency);
Assert.AreEqual(Convert.ToByte(isVisible), backgroundMapDataEntity.IsVisible);
- Assert.IsNull(backgroundMapDataEntity.SelectedCapabilityName);
- Assert.IsNull(backgroundMapDataEntity.SourceCapabilitiesUrl);
- Assert.IsNull(backgroundMapDataEntity.PreferredFormat);
+ CollectionAssert.IsEmpty(backgroundMapDataEntity.BackgroundDataMetaEntities);
}
[Test]
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/BackgroundDataCreateExtensionsTest.cs
===================================================================
diff -u -r258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/BackgroundDataCreateExtensionsTest.cs (.../BackgroundDataCreateExtensionsTest.cs) (revision 258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/BackgroundDataCreateExtensionsTest.cs (.../BackgroundDataCreateExtensionsTest.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -23,10 +23,7 @@
using Application.Ringtoets.Storage.Create;
using Application.Ringtoets.Storage.DbContext;
using Core.Common.Base.Data;
-using Core.Components.Gis;
-using Core.Components.Gis.Data;
using NUnit.Framework;
-using Ringtoets.Common.Data;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.TestUtil;
@@ -79,7 +76,7 @@
};
// Call
- BackgroundMapDataEntity entity = backgroundData.Create();
+ BackgroundDataEntity entity = backgroundData.Create();
// Assert
Assert.AreEqual(name, entity.Name);
@@ -88,15 +85,27 @@
if (isConfigured)
{
- Assert.AreEqual(sourceCapabilitiesUrl, entity.SourceCapabilitiesUrl);
- Assert.AreEqual(selectedCapabilityName, entity.SelectedCapabilityName);
- Assert.AreEqual(preferredFormat, entity.PreferredFormat);
+ Assert.AreEqual(3, entity.BackgroundDataMetaEntities.Count);
+
+ foreach (BackgroundDataMetaEntity backgroundDataMetaEntity in entity.BackgroundDataMetaEntities)
+ {
+ 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);
+ }
+ }
}
else
{
- Assert.IsNull(entity.SourceCapabilitiesUrl);
- Assert.IsNull(entity.SelectedCapabilityName);
- Assert.IsNull(entity.PreferredFormat);
+ CollectionAssert.IsEmpty(entity.BackgroundDataMetaEntities);
}
}
@@ -107,7 +116,7 @@
var backgroundData = BackgroundDataTestDataGenerator.GetWellKnownBackgroundMapData();
// Call
- BackgroundMapDataEntity entity = backgroundData.Create();
+ BackgroundDataEntity entity = backgroundData.Create();
// Assert
Assert.IsNull(entity); // TODO: WTI-1141
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs
===================================================================
diff -u -r258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs (.../AssessmentSectionEntityReadExtensionsTest.cs) (revision 258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs (.../AssessmentSectionEntityReadExtensionsTest.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -28,10 +28,7 @@
using Core.Common.Base;
using Core.Common.Base.Geometry;
using Core.Common.TestUtil;
-using Core.Components.Gis;
-using Core.Components.Gis.Data;
using NUnit.Framework;
-using Ringtoets.Common.Data;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.Calculation;
using Ringtoets.Common.Data.DikeProfiles;
@@ -76,7 +73,7 @@
Comments = comments,
Norm = norm
};
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -109,22 +106,34 @@
const string preferredFormat = "image/png";
var entity = CreateAssessmentSectionEntity();
- BackgroundMapDataEntity backgroundMapDataEntity = new BackgroundMapDataEntity
+ BackgroundDataEntity backgroundDataEntity = new BackgroundDataEntity
{
Name = mapDataName,
Transparency = transparency,
- IsVisible = Convert.ToByte(isVisible)
+ IsVisible = Convert.ToByte(isVisible),
+ IsConfigured = Convert.ToByte(isConfigured),
+ BackgroundDataMetaEntities = new List
+ {
+ new BackgroundDataMetaEntity
+ {
+ Key = BackgroundDataIdentifiers.SourceCapabilitiesUrl,
+ Value = sourceCapabilitiesUrl
+ },
+ new BackgroundDataMetaEntity
+ {
+ Key = BackgroundDataIdentifiers.SelectedCapabilityIdentifier,
+ Value = selectedCapabilityName
+ },
+ new BackgroundDataMetaEntity
+ {
+ Key = BackgroundDataIdentifiers.PreferredFormat,
+ Value = preferredFormat
+ }
+ }
};
- if (isConfigured)
- {
- backgroundMapDataEntity.SourceCapabilitiesUrl = sourceCapabilitiesUrl;
- backgroundMapDataEntity.SelectedCapabilityName = selectedCapabilityName;
- backgroundMapDataEntity.PreferredFormat = preferredFormat;
- }
+ entity.BackgroundDataEntities.Add(backgroundDataEntity);
- entity.BackgroundMapDataEntities.Add(backgroundMapDataEntity);
-
var collector = new ReadConversionCollector();
// Call
@@ -167,7 +176,7 @@
new Point2D(secondX, secondY)
};
entity.ReferenceLinePointXml = new Point2DXmlSerializer().ToXml(points);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -199,7 +208,7 @@
Name = "B",
Order = 0
});
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -247,7 +256,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -296,7 +305,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -342,7 +351,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -383,7 +392,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -423,7 +432,7 @@
});
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -463,7 +472,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -510,7 +519,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -543,7 +552,7 @@
CalculationGroupEntity = rootGroupEntity
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -583,7 +592,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -630,7 +639,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -678,7 +687,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -715,7 +724,7 @@
NotRelevantComments = notRelevantComments
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -754,7 +763,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -798,7 +807,7 @@
IsRelevant = Convert.ToByte(isRelevant)
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -835,7 +844,7 @@
NotRelevantComments = notRelevantComments
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -878,7 +887,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -919,7 +928,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -959,7 +968,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -1001,7 +1010,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -1043,7 +1052,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -1084,7 +1093,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -1117,7 +1126,7 @@
}
};
entity.FailureMechanismEntities.Add(failureMechanismEntity);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -1161,7 +1170,7 @@
entity.FailureMechanismEntities.Add(grassRevetmentSlidingOutwards);
entity.FailureMechanismEntities.Add(grassRevetmentSlidingInwards);
entity.FailureMechanismEntities.Add(technicalInnovations);
- entity.BackgroundMapDataEntities.Add(CreateBackgroundMapDataEntity());
+ entity.BackgroundDataEntities.Add(CreateBackgroundDataEntity());
var collector = new ReadConversionCollector();
@@ -1202,9 +1211,9 @@
};
}
- private static BackgroundMapDataEntity CreateBackgroundMapDataEntity()
+ private static BackgroundDataEntity CreateBackgroundDataEntity()
{
- return new BackgroundMapDataEntity
+ return new BackgroundDataEntity
{
Name = "Background",
Transparency = 0.0,
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/BackgroundDataMetaEntityReadExtensionsTest.cs
===================================================================
diff -u
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/BackgroundDataMetaEntityReadExtensionsTest.cs (revision 0)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/BackgroundDataMetaEntityReadExtensionsTest.cs (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -0,0 +1,65 @@
+// Copyright (C) Stichting Deltares 2016. 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 System.Collections.Generic;
+using Application.Ringtoets.Storage.DbContext;
+using Application.Ringtoets.Storage.Read;
+using NUnit.Framework;
+
+namespace Application.Ringtoets.Storage.Test.Read
+{
+ [TestFixture]
+ public class BackgroundDataMetaEntityReadExtensionsTest
+ {
+ [Test]
+ public void Read_EntityNull_ThrowArgumentNullException()
+ {
+ // Setup
+ BackgroundDataMetaEntity entity = null;
+
+ // Call
+ TestDelegate test = () => entity.Read();
+
+ // Assert
+ var exception = Assert.Throws(test);
+ Assert.AreEqual("entity", exception.ParamName);
+ }
+
+ [Test]
+ public void Read_WithEntity_ReturnKeyValuePairWithData()
+ {
+ // Setup
+ BackgroundDataMetaEntity entity = new BackgroundDataMetaEntity
+ {
+ Key = "Test key",
+ Value = "Test value"
+ };
+
+ // Call
+ KeyValuePair data = entity.Read();
+
+ // Assert
+ Assert.AreEqual(entity.Key, data.Key);
+ Assert.AreEqual(entity.Value, data.Value);
+ }
+ }
+}
\ No newline at end of file
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/BackgroundMapDataEntityReadExtensionsTest.cs
===================================================================
diff -u -r258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/BackgroundMapDataEntityReadExtensionsTest.cs (.../BackgroundMapDataEntityReadExtensionsTest.cs) (revision 258acae55e0ae70bcc094a2f7a577b7fbc8d8f2e)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/BackgroundMapDataEntityReadExtensionsTest.cs (.../BackgroundMapDataEntityReadExtensionsTest.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -20,6 +20,7 @@
// All rights reserved.
using System;
+using System.Collections.Generic;
using Application.Ringtoets.Storage.DbContext;
using Application.Ringtoets.Storage.Read;
using NUnit.Framework;
@@ -34,7 +35,7 @@
public void Read_EntityNull_ThrowArgumentNullException()
{
// Setup
- BackgroundMapDataEntity entity = null;
+ BackgroundDataEntity entity = null;
// Call
TestDelegate test = () => entity.Read();
@@ -54,15 +55,32 @@
const string preferredFormat = "image/jpeg";
const bool isVisible = false;
const double transparancy = 0.4;
+ const bool isConfigured = true;
- var entity = new BackgroundMapDataEntity
+ var entity = new BackgroundDataEntity
{
Name = name,
- SourceCapabilitiesUrl = url,
- SelectedCapabilityName = capabilityName,
- PreferredFormat = preferredFormat,
+ BackgroundDataMetaEntities = new List
+ {
+ new BackgroundDataMetaEntity
+ {
+ Key = BackgroundDataIdentifiers.SourceCapabilitiesUrl,
+ Value = url
+ },
+ new BackgroundDataMetaEntity
+ {
+ Key = BackgroundDataIdentifiers.SelectedCapabilityIdentifier,
+ Value = capabilityName
+ },
+ new BackgroundDataMetaEntity
+ {
+ Key = BackgroundDataIdentifiers.PreferredFormat,
+ Value = preferredFormat
+ }
+ },
IsVisible = Convert.ToByte(isVisible),
- Transparency = transparancy
+ Transparency = transparancy,
+ IsConfigured = Convert.ToByte(isConfigured)
};
// Call
@@ -76,34 +94,74 @@
Assert.AreEqual(url, backgroundData.Parameters[BackgroundDataIdentifiers.SourceCapabilitiesUrl]);
Assert.AreEqual(capabilityName, backgroundData.Parameters[BackgroundDataIdentifiers.SelectedCapabilityIdentifier]);
Assert.AreEqual(preferredFormat, backgroundData.Parameters[BackgroundDataIdentifiers.PreferredFormat]);
- Assert.IsTrue(backgroundData.IsConfigured);
+ Assert.AreEqual(isConfigured, backgroundData.IsConfigured);
}
[Test]
- public void Read_ConfigurableColumnsNull_ReturnBackgroundDataWithoutParameters()
+ public void Read_IsConfiguredFalse_NoParametersAdded()
{
// Setup
- const string name = "map data";
- const bool isVisible = false;
- const double transparancy = 0.4;
+ const bool isConfigured = false;
- var entity = new BackgroundMapDataEntity
+ var entity = new BackgroundDataEntity
{
- Name = name,
- IsVisible = Convert.ToByte(isVisible),
- Transparency = transparancy
+ BackgroundDataMetaEntities = new List
+ {
+ new BackgroundDataMetaEntity
+ {
+ Key = BackgroundDataIdentifiers.SourceCapabilitiesUrl,
+ Value = "//url"
+ },
+ new BackgroundDataMetaEntity
+ {
+ Key = BackgroundDataIdentifiers.SelectedCapabilityIdentifier,
+ Value = "capability name"
+ },
+ new BackgroundDataMetaEntity
+ {
+ Key = BackgroundDataIdentifiers.PreferredFormat,
+ Value = "image/jpeg"
+ }
+ },
+ IsConfigured = Convert.ToByte(isConfigured)
};
// Call
BackgroundData backgroundData = entity.Read();
// Assert
- Assert.AreEqual(isVisible, backgroundData.IsVisible);
- Assert.AreEqual(transparancy, backgroundData.Transparency.Value);
-
- Assert.AreEqual(name, backgroundData.Name);
CollectionAssert.IsEmpty(backgroundData.Parameters);
- Assert.IsFalse(backgroundData.IsConfigured);
+ Assert.AreEqual(isConfigured, backgroundData.IsConfigured);
}
+
+ [Test]
+ public void Read_BackgroundDataMetaEntityKeyNotValid_MetaDataNotAddedToBackgroundData()
+ {
+ // Setup
+ var entity = new BackgroundDataEntity
+ {
+ BackgroundDataMetaEntities = new List
+ {
+ new BackgroundDataMetaEntity
+ {
+ Key = "some key",
+ Value = "//url"
+ },
+ new BackgroundDataMetaEntity
+ {
+ Key = BackgroundDataIdentifiers.SelectedCapabilityIdentifier,
+ Value = "capability name"
+ }
+ },
+ IsConfigured = Convert.ToByte(true)
+ };
+
+ // Call
+ BackgroundData backgroundData = entity.Read();
+
+ // Assert
+ Assert.AreEqual(1, backgroundData.Parameters.Count);
+ CollectionAssert.DoesNotContain(backgroundData.Parameters, "some key");
+ }
}
}
\ No newline at end of file
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ProjectEntityReadExtensionsTest.cs
===================================================================
diff -u -r03a263822252a5020135a7de96ea8e50d5eb5cc6 -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ProjectEntityReadExtensionsTest.cs (.../ProjectEntityReadExtensionsTest.cs) (revision 03a263822252a5020135a7de96ea8e50d5eb5cc6)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ProjectEntityReadExtensionsTest.cs (.../ProjectEntityReadExtensionsTest.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -79,9 +79,9 @@
Name = "A",
Order = 56,
Composition = Convert.ToByte(AssessmentSectionComposition.Dike),
- BackgroundMapDataEntities = new[]
+ BackgroundDataEntities = new[]
{
- new BackgroundMapDataEntity
+ new BackgroundDataEntity
{
Name = "Background A",
Transparency = 0.0,
@@ -95,9 +95,9 @@
Name = "B",
Order = 0,
Composition = Convert.ToByte(AssessmentSectionComposition.Dike),
- BackgroundMapDataEntities = new[]
+ BackgroundDataEntities = new[]
{
- new BackgroundMapDataEntity
+ new BackgroundDataEntity
{
Name = "Background B",
Transparency = 0.0,
Index: Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/BackgroundMapDataType.cs
===================================================================
diff -u -r7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4 -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/BackgroundMapDataType.cs (.../BackgroundMapDataType.cs) (revision 7a4f8ff71ae5f81177fe5ff9cd78fdc7f24c69f4)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/AssessmentSection/BackgroundMapDataType.cs (.../BackgroundMapDataType.cs) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -29,11 +29,11 @@
///
/// Web Map Tile Service background map data type.
///
- Wmts,
+ Wmts = 0,
///
/// Well known tile source background map data type.
///
- WellKnown
+ WellKnown = 1
}
}
\ No newline at end of file
Index: build/DatabaseStructure.sql
===================================================================
diff -u -r873bd2b6b7b9d0737dde2ed16ff5d10a66795a2f -r40793165416093e9d2fefb6b12acf82fbd8a84c2
--- build/DatabaseStructure.sql (.../DatabaseStructure.sql) (revision 873bd2b6b7b9d0737dde2ed16ff5d10a66795a2f)
+++ build/DatabaseStructure.sql (.../DatabaseStructure.sql) (revision 40793165416093e9d2fefb6b12acf82fbd8a84c2)
@@ -1,6 +1,6 @@
/* ---------------------------------------------------- */
/* Generated by Enterprise Architect Version 12.0 */
-/* Created On : 07-mrt-2017 08:22:26 */
+/* Created On : 09-Mar-2017 11:11:11 */
/* DBMS : SQLite */
/* ---------------------------------------------------- */
@@ -204,9 +204,12 @@
DROP TABLE IF EXISTS 'DuneLocationOutputEntity'
;
-DROP TABLE IF EXISTS 'BackgroundMapDataEntity'
+DROP TABLE IF EXISTS 'BackgroundDataEntity'
;
+DROP TABLE IF EXISTS 'BackgroundDataMetaEntity'
+;
+
/* Create Tables with Primary and Foreign Keys, Check and Unique Constraints */
CREATE TABLE 'VersionEntity'
@@ -1336,20 +1339,30 @@
)
;
-CREATE TABLE 'BackgroundMapDataEntity'
+CREATE TABLE 'BackgroundDataEntity'
(
- 'BackgroundMapDataEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ 'BackgroundDataEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
'AssessmentSectionEntityId' INTEGER NOT NULL,
'Name' TEXT NOT NULL,
- 'SourceCapabilitiesUrl' TEXT,
- 'SelectedCapabilityName' TEXT,
- 'PreferredFormat' VARCHAR (255),
'IsVisible' TINYINT (1) NOT NULL, -- true or false
'Transparency' REAL NOT NULL,
+ 'IsConfigured' TINYINT (1) NOT NULL, -- true or false
+ 'BackgroundDataType' TINYINT (1) NOT NULL, -- Enum: 0 = Wmts, 1 = WellKnown
CONSTRAINT 'FK_WmtsMapDataEntity_AssessmentSectionEntity' FOREIGN KEY ('AssessmentSectionEntityId') REFERENCES 'AssessmentSectionEntity' ('AssessmentSectionEntityId') ON DELETE Cascade ON UPDATE Cascade
)
;
+CREATE TABLE 'BackgroundDataMetaEntity'
+(
+ 'BackgroundDataMetaEntityId' INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
+ 'BackgroundDataEntityId' INTEGER NOT NULL,
+ 'Key' TEXT NOT NULL,
+ 'Value' TEXT NOT NULL,
+ CONSTRAINT 'FK_BackgroundDataMetaEntity_BackgroundDataEntity' FOREIGN KEY ('BackgroundDataEntityId') REFERENCES 'BackgroundDataEntity' ('BackgroundDataEntityId') ON DELETE Cascade ON UPDATE Cascade,
+ CONSTRAINT 'U_BackgroundDataEntityId_Key' UNIQUE ('BackgroundDataEntityId','Key')
+)
+;
+
/* Create Indexes and Triggers */
CREATE INDEX 'IXFK_GrassCoverErosionInwardsDikeHeightOutputEntity_GrassCoverErosionInwardsOutputEntity'
@@ -1705,5 +1718,9 @@
;
CREATE INDEX 'IXFK_WmtsMapDataEntity_AssessmentSectionEntity'
- ON 'BackgroundMapDataEntity' ('AssessmentSectionEntityId' ASC)
+ ON 'BackgroundDataEntity' ('AssessmentSectionEntityId' ASC)
;
+
+CREATE INDEX 'IXFK_BackgroundDataMetaEntity_BackgroundDataEntity'
+ ON 'BackgroundDataMetaEntity' ('BackgroundDataEntityId' ASC)
+;
Index: design/DatabaseDesign.eap
===================================================================
diff -u -r873bd2b6b7b9d0737dde2ed16ff5d10a66795a2f -r40793165416093e9d2fefb6b12acf82fbd8a84c2
Binary files differ