Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilProfilePropertiesTest.cs =================================================================== diff -u -r25d9f184b0a7bf99101d2ec0b1089ba2aeed9080 -r026b524685096af08e8adfd99406eab049506c3b --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilProfilePropertiesTest.cs (.../StochasticSoilProfilePropertiesTest.cs) (revision 25d9f184b0a7bf99101d2ec0b1089ba2aeed9080) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/StochasticSoilProfilePropertiesTest.cs (.../StochasticSoilProfilePropertiesTest.cs) (revision 026b524685096af08e8adfd99406eab049506c3b) @@ -44,8 +44,27 @@ } [Test] - public void GetProperties_WithData_ReturnExpectedValues() + [TestCase(0.14, "14")] + [TestCase(1.0051, "100,51")] + [TestCase(0.5 + 1e-6, "50")] + [SetCulture("nl-NL")] + public void GetProperties_WithDataAndDutchLocale_ReturnExpectedValues(double probability, string expectedProbability) { + GetProperties_WithData_ReturnExpectedValues(probability, expectedProbability); + } + + [Test] + [TestCase(0.14, "14")] + [TestCase(1.0051, "100.51")] + [TestCase(0.5 + 1e-6, "50")] + [SetCulture("en-US")] + public void GetProperties_WithDataAndEnglishLocale_ReturnExpectedValues(double probability, string expectedProbability) + { + GetProperties_WithData_ReturnExpectedValues(probability, expectedProbability); + } + + private static void GetProperties_WithData_ReturnExpectedValues(double probability, string expectedProbability) + { // Setup const string expectedName = ""; IEnumerable layers = new[] @@ -58,7 +77,7 @@ }; var soilProfile = new PipingSoilProfile(expectedName, -5.0, layers, 0); - var stochasticSoilProfile = new StochasticSoilProfile(1.0, SoilProfileType.SoilProfile1D, 1234L) + var stochasticSoilProfile = new StochasticSoilProfile(probability, SoilProfileType.SoilProfile1D, 1234L) { SoilProfile = soilProfile }; @@ -74,7 +93,7 @@ Assert.AreEqual(expectedName, properties.ToString()); CollectionAssert.AreEqual(soilProfile.Layers.Select(l => l.Top), properties.TopLevels); Assert.AreEqual(soilProfile.Bottom, properties.Bottom); - Assert.AreEqual(stochasticSoilProfile.Probability*100, properties.Probability); + Assert.AreEqual(expectedProbability, properties.Probability); Assert.AreEqual("1D profiel", properties.Type); } }