Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/LocationTest.cs =================================================================== diff -u -r5514 -r5515 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/LocationTest.cs (.../LocationTest.cs) (revision 5514) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/LocationTest.cs (.../LocationTest.cs) (revision 5515) @@ -22,6 +22,7 @@ using System.Collections.Generic; using Deltares.Dam.Data; using Deltares.Standard.Language; +using Deltares.Standard.Validation; using NUnit.Framework; namespace Deltares.Dam.Tests @@ -48,7 +49,7 @@ } Assert.That(actualLocation.DampingFactorPL3, - Is.EqualTo(expectedLocation.DampingFactorPL3).Within(cTolerance)); + Is.EqualTo(expectedLocation.DampingFactorPL3).Within(cTolerance)); } } @@ -78,27 +79,26 @@ Assert.That(actualLocation.StabilityShoulderGrowDeltaX, Is.EqualTo(stabilityShoulderGrowDeltaX)); Assert.That(actualLocation.StabilitySlopeAdaptionDeltaX, Is.EqualTo(stabilitySlopeAdaptionDeltaX)); } - + [Test] - [TestCase(0,IntrusionVerticalWaterPressureType.Standard, "")] + [TestCase(0, IntrusionVerticalWaterPressureType.Standard, "")] [TestCase(0, IntrusionVerticalWaterPressureType.HydroStatic, "")] [TestCase(0, IntrusionVerticalWaterPressureType.FullHydroStatic, "")] [TestCase(0, IntrusionVerticalWaterPressureType.Linear, "")] [TestCase(0, IntrusionVerticalWaterPressureType.SemiTimeDependent, "UseOfSemiTimeDependentModelWithoutPenetrationLength")] - [TestCase(1,IntrusionVerticalWaterPressureType.Standard, "UseOfPenetrationLengthWithoutSemiTimeDependentModel")] + [TestCase(1, IntrusionVerticalWaterPressureType.Standard, "UseOfPenetrationLengthWithoutSemiTimeDependentModel")] [TestCase(1, IntrusionVerticalWaterPressureType.HydroStatic, "UseOfPenetrationLengthWithoutSemiTimeDependentModel")] [TestCase(1, IntrusionVerticalWaterPressureType.FullHydroStatic, "UseOfPenetrationLengthWithoutSemiTimeDependentModel")] [TestCase(1, IntrusionVerticalWaterPressureType.Linear, "UseOfPenetrationLengthWithoutSemiTimeDependentModel")] [TestCase(1, IntrusionVerticalWaterPressureType.SemiTimeDependent, "")] public void GivenPenetrationLengthWithIntrusionVerticalWaterPressureType_WhenValidating_ReturnsExpectedWarning(double penetrationLength, IntrusionVerticalWaterPressureType model, string expectedWarning) { - var location = new Location(); location.IntrusionVerticalWaterPressure = model; location.PenetrationLength = penetrationLength; - - Standard.Validation.ValidationResult[] validationResults = location.ValidateLocationUseOfPenetrationLength(); + ValidationResult[] validationResults = location.ValidateLocationUseOfPenetrationLength(); + if (expectedWarning == "") { Assert.That(validationResults, Has.Length.EqualTo(0)); @@ -108,16 +108,14 @@ Assert.Multiple(() => { Assert.That(validationResults, Has.Length.EqualTo(1)); - Assert.That(validationResults[0].MessageType, Is.EqualTo(Standard.Validation.ValidationResultType.Warning)); - + Assert.That(validationResults[0].MessageType, Is.EqualTo(ValidationResultType.Warning)); + string header = LocalizationManager.GetTranslatedText(typeof(Location), "IntrusionVerticalWaterPressure"); string selectedModel = LocalizationManager.GetTranslatedText(typeof(Location), model.ToString()); string message = string.Format(LocalizationManager.GetTranslatedText(typeof(Location), expectedWarning), [header, selectedModel]); Assert.That(validationResults[0].Text, Is.EqualTo(message)); - }); } - } } } \ No newline at end of file