Index: Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj =================================================================== diff -u -rae772a69de783815504f095c4d1b7ea83a6716c2 -r58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a --- Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision ae772a69de783815504f095c4d1b7ea83a6716c2) +++ Ringtoets/Common/src/Ringtoets.Common.IO/Ringtoets.Common.IO.csproj (.../Ringtoets.Common.IO.csproj) (revision 58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a) @@ -116,6 +116,7 @@ + @@ -125,7 +126,8 @@ - + + Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/ISoilProfile.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/ISoilProfile.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/ISoilProfile.cs (revision 58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a) @@ -0,0 +1,34 @@ +// Copyright (C) Stichting Deltares 2017. 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. + +namespace Ringtoets.Common.IO.SoilProfile +{ + /// + /// This class represents a soil profile. + /// + public interface ISoilProfile + { + /// + /// Gets the name of . + /// + string Name { get; } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile1D.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile1D.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile1D.cs (revision 58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a) @@ -0,0 +1,47 @@ +// Copyright (C) Stichting Deltares 2017. 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. + +namespace Ringtoets.Common.IO.SoilProfile +{ + /// + /// This class represents a one dimensional soil profile. + /// + public class SoilProfile1D : ISoilProfile + { + /// + /// Creates a new instance of . + /// + /// The name of the profile. + /// The bottom level of the profile. + public SoilProfile1D(string name, double bottom) + { + Name = name; + Bottom = bottom; + } + + /// + /// Gets the bottom level of the . + /// + public double Bottom { get; } + + public string Name { get; } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile2D.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile2D.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfile2D.cs (revision 58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a) @@ -0,0 +1,40 @@ +// Copyright (C) Stichting Deltares 2017. 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. + +namespace Ringtoets.Common.IO.SoilProfile +{ + /// + /// This class represents a two dimensional soil profile. + /// + public class SoilProfile2D : ISoilProfile + { + /// + /// Creates a new instance of . + /// + /// The name of the profile. + public SoilProfile2D(string name) + { + Name = name; + } + + public string Name { get; } + } +} \ No newline at end of file Fisheye: Tag 58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilProfileType.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilProfile.cs =================================================================== diff -u -rae772a69de783815504f095c4d1b7ea83a6716c2 -r58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilProfile.cs (.../StochasticSoilProfile.cs) (revision ae772a69de783815504f095c4d1b7ea83a6716c2) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/StochasticSoilProfile.cs (.../StochasticSoilProfile.cs) (revision 58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a) @@ -40,18 +40,20 @@ /// /// Database identifier of the stochastic soil profile. /// Probability of the stochastic soil profile. - /// Type of the stochastic soil profile. - public StochasticSoilProfile(long soilProfileId, double probability, SoilProfileType soilProfileType) + /// The soil profile. + /// Thrown when the + /// is outside the range [0, 1]. + public StochasticSoilProfile(long soilProfileId, double probability, ISoilProfile soilProfile) { Probability = probability; - SoilProfileType = soilProfileType; + SoilProfile = soilProfile; SoilProfileId = soilProfileId; } /// - /// Gets the type of the stochastic soil profile. + /// Gets the soil profile. /// - public SoilProfileType SoilProfileType { get; private set; } + public ISoilProfile SoilProfile { get; } /// /// Gets the database identifier of the stochastic soil profile. Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj =================================================================== diff -u -rae772a69de783815504f095c4d1b7ea83a6716c2 -r58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj (.../Ringtoets.Common.IO.Test.csproj) (revision ae772a69de783815504f095c4d1b7ea83a6716c2) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Ringtoets.Common.IO.Test.csproj (.../Ringtoets.Common.IO.Test.csproj) (revision 58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a) @@ -112,6 +112,8 @@ + + Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile1DTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile1DTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile1DTest.cs (revision 58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a) @@ -0,0 +1,48 @@ +// Copyright (C) Stichting Deltares 2017. 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 NUnit.Framework; +using Ringtoets.Common.IO.SoilProfile; + +namespace Ringtoets.Common.IO.Test.SoilProfile +{ + [TestFixture] + public class SoilProfile1DTest + { + [Test] + public void Constructor_ValidArguments_ReturnsExpectedProperties() + { + // Setup + const string name = "some name"; + var random = new Random(9); + int bottom = random.Next(); + + // Call + var soilProfile1D = new SoilProfile1D(name, bottom); + + // Assert + Assert.IsInstanceOf(soilProfile1D); + Assert.AreEqual(name, soilProfile1D.Name); + Assert.AreEqual(bottom, soilProfile1D.Bottom); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile2DTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile2DTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilProfile2DTest.cs (revision 58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a) @@ -0,0 +1,45 @@ +// Copyright (C) Stichting Deltares 2017. 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 NUnit.Framework; +using Ringtoets.Common.IO.SoilProfile; + +namespace Ringtoets.Common.IO.Test.SoilProfile +{ + [TestFixture] + public class SoilProfile2DTest + { + [Test] + public void Constructor_ValidArguments_ReturnsExpectedProperties() + { + // Setup + const string name = "some name"; + ; + + // Call + var soilProfile2D = new SoilProfile2D(name); + + // Assert + Assert.IsInstanceOf(soilProfile2D); + Assert.AreEqual(name, soilProfile2D.Name); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/StochasticSoilProfileTest.cs =================================================================== diff -u -rae772a69de783815504f095c4d1b7ea83a6716c2 -r58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/StochasticSoilProfileTest.cs (.../StochasticSoilProfileTest.cs) (revision ae772a69de783815504f095c4d1b7ea83a6716c2) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/StochasticSoilProfileTest.cs (.../StochasticSoilProfileTest.cs) (revision 58d98ab4a0a75497b2752eff1a931f6f7ee3fa8a) @@ -22,6 +22,7 @@ using System; using Core.Common.TestUtil; using NUnit.Framework; +using Rhino.Mocks; using Ringtoets.Common.IO.SoilProfile; namespace Ringtoets.Common.IO.Test.SoilProfile @@ -39,34 +40,44 @@ public void Constructor_WithInvalidProbabilities_ThrowsArgumentOutOfRangeException(double probability) { // Setup + var mockRepository = new MockRepository(); + var soilProfile = mockRepository.Stub(); + mockRepository.ReplayAll(); + var random = new Random(9); - var soilProfileType = random.NextEnumValue(); int soilProfileId = random.Next(); // Call - TestDelegate test = () => new StochasticSoilProfile(soilProfileId, probability, soilProfileType); + TestDelegate test = () => new StochasticSoilProfile(soilProfileId, probability, soilProfile); // Assert const string expectedMessage = "Het aandeel van de ondergrondschematisatie in het stochastische ondergrondmodel moet in het bereik [0,0, 1,0] liggen."; TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + + mockRepository.VerifyAll(); } [TestCase] - public void Constructor_WithValidProperties_ExpectedValues() + public void Constructor_WithValidArguments_ExpectedValues() { // Setup + var mockRepository = new MockRepository(); + var soilProfile = mockRepository.Stub(); + mockRepository.ReplayAll(); + var random = new Random(9); double probability = random.NextDouble(); - var soilProfileType = random.NextEnumValue(); int soilProfileId = random.Next(); // Call - var profile = new StochasticSoilProfile(soilProfileId, probability, soilProfileType); + var profile = new StochasticSoilProfile(soilProfileId, probability, soilProfile); // Assert Assert.AreEqual(probability, profile.Probability); - Assert.AreEqual(soilProfileType, profile.SoilProfileType); + Assert.AreSame(soilProfile, profile.SoilProfile); Assert.AreEqual(soilProfileId, profile.SoilProfileId); + + mockRepository.VerifyAll(); } } } \ No newline at end of file