Index: DamClients/DamUI/trunk/src/Dam/Tests/Deltares.Dam.Tests.csproj =================================================================== diff -u -r2796 -r2929 --- DamClients/DamUI/trunk/src/Dam/Tests/Deltares.Dam.Tests.csproj (.../Deltares.Dam.Tests.csproj) (revision 2796) +++ DamClients/DamUI/trunk/src/Dam/Tests/Deltares.Dam.Tests.csproj (.../Deltares.Dam.Tests.csproj) (revision 2929) @@ -225,6 +225,9 @@ + + PreserveNewest + PreserveNewest Index: DamClients/DamUI/trunk/src/Dam/Tests/DamProjectTest/DamProjectTestMSoilbaseRead.mdb =================================================================== diff -u Binary files differ Index: DamClients/DamUI/trunk/src/Dam/Tests/DikeTest.cs =================================================================== diff -u -r875 -r2929 --- DamClients/DamUI/trunk/src/Dam/Tests/DikeTest.cs (.../branches/CalcualtionIncluded/src/Dam/Tests/DikeTest.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/DikeTest.cs (.../trunk/src/Dam/Tests/DikeTest.cs) (revision 2929) @@ -1,15 +1,25 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2009 Deltares. All rights reserved. -// -// R.C. Blankenburgh -// remko.blankenburgh@deltares.nl -// 18-05-2009 -// Contains tests for class Deltares.Dam.Data.Dike -//----------------------------------------------------------------------- +// Copyright (C) Stichting Deltares 2018. All rights reserved. +// +// This file is part of the application DAM - UI. +// +// DAM - UI 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 Deltares.Geometry; -using Deltares.Geotechnics; using Deltares.Geotechnics.GeotechnicalGeometry; using Deltares.Dam.Data; using NUnit.Framework; @@ -23,7 +33,7 @@ public class DikeTest { private Dike dike; - private Dam.Data.Segment segment1; + private Segment segment1; private Location location1; private SurfaceLine2 surfaceLine1; private SoilProfile1D soilProfile; @@ -197,37 +207,5 @@ Assert.IsTrue(this.surfaceLine1.HasDike()); } - -// private Dike CreateDikeWith2DGeometrySegements() -// { -// dike = new Dike(); -// dike.Name = "Dike"; -// - // Segments - // Segment 1 -// var segment = new Dam.Data.Segment(); -// segment.Name = "Segment1"; -// SoilGeometryProbability soilGeometryProbability = new SoilGeometryProbability(); -// soilGeometryProbability.SoilGeometry2DName = "Geometry1"; -// segment.SoilProfileProbabilities.Add(soilGeometryProbability); -// dike.Segments.Add(segment); - // Segment 2 -// segment = new Dam.Data.Segment(); -// segment.Name = "Segment2"; -// soilGeometryProbability = new SoilGeometryProbability(); -// soilGeometryProbability.SoilGeometry2DName = "Geometry2"; -// segment.SoilProfileProbabilities.Add(soilGeometryProbability); -// dike.Segments.Add(segment); -// -// return dike; -// } -// -// [Test] -// public void CanAddGeometry2DNamesFromSegments() -// { -// Dike dike = CreateDikeWith2DGeometrySegements(); -// dike.FillGeometry2DNamesFromSegments(); -// Assert.AreEqual(2, dike.SoilGeometry2DNames.Count); -// } } } Index: DamClients/DamUI/trunk/src/Dam/Tests/DamProjectTest.cs =================================================================== diff -u -r875 -r2929 --- DamClients/DamUI/trunk/src/Dam/Tests/DamProjectTest.cs (.../branches/CalcualtionIncluded/src/Dam/Tests/DamProjectTest.cs) (revision 875) +++ DamClients/DamUI/trunk/src/Dam/Tests/DamProjectTest.cs (.../trunk/src/Dam/Tests/DamProjectTest.cs) (revision 2929) @@ -1,25 +1,40 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2011 Deltares. All rights reserved. -// -// Tom The -// tom.the@deltares.nl -// 10-08-2011 -// n.a. -//----------------------------------------------------------------------- +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of the application DAM - UI. +// +// DAM - UI 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 Deltares.Geotechnics.Soils; +using Deltares.Soilbase; + namespace Deltares.Dam.Tests { using System.IO; using NUnit.Framework; - using Deltares.Dam.Data; + using Data; [TestFixture] public class DamProjectTest { [Test] public void CanDetermineProjectWorkingPathApplication() { - Data.DamProject.ProjectWorkingPathLocation = ProjectPathLocation.InApplicationMap; + DamProject.ProjectWorkingPathLocation = ProjectPathLocation.InApplicationMap; string projectWorkingPath = DamProject.ProjectWorkingPath; Assert.AreEqual(Path.GetDirectoryName(typeof(DamProject).Assembly.Location) + @"\DamCalculation", projectWorkingPath); } @@ -100,5 +115,25 @@ Assert.AreEqual(mapName2, damProject.DamProjectData.WaterBoard.Dikes[2].MapForSoilGeometries2D); } } + [Test] + public void GivenMSoilbaseDatabaseWhenReadingSoilsThenCorrectParametersAreRead() + { + const double tolerance = 0.005; + // Given MSoilbase Database + const string databaseFilename = @"DamProjectTest\DamProjectTestMSoilbaseRead.mdb"; + using (var geoDatabase = new GeoDatabase(databaseFilename)) + { + // When Reading Soils + geoDatabase.ReUseSoils = true; + var soilList = geoDatabase.ReadSoils(null); + + // Then Correct Parameters Are Read + Assert.AreEqual(4, soilList.Soils.Count); // 3 real soils and 1 undetermined soil + Soil soil = soilList.GetSoilByName("HW-DUN"); + Assert.AreEqual(15.80, soil.AbovePhreaticLevel, tolerance); + Assert.AreEqual(16.80, soil.BelowPhreaticLevel, tolerance); + + } + } } }