Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/TestData/Geometry2DImporter/SimpleProfile.stix =================================================================== diff -u Binary files differ Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Geometry2DImporter/SoilProfile2DImporterTest.cs =================================================================== diff -u -r5950 -r5988 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Geometry2DImporter/SoilProfile2DImporterTest.cs (.../SoilProfile2DImporterTest.cs) (revision 5950) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Geometry2DImporter/SoilProfile2DImporterTest.cs (.../SoilProfile2DImporterTest.cs) (revision 5988) @@ -35,8 +35,7 @@ [TestFixture] public class SoilProfile2DImporterTest { - private const string StiTestDataFolder = @"TestData\StiImporter\"; - private const string StixTestDataFolder = @"TestData\Geometry2DImporter\"; + private const string stixTestDataFolder = @"TestData\Geometry2DImporter\"; [Test] [TestCase(null)] @@ -76,12 +75,12 @@ .EqualTo("availableSoils")); } - [Test, Ignore("Is sti based, maybe replace with a test that uses stix files")] + [Test] public void Import_WithValidArguments_ReturnsExpectedSoilProfiles() { // Setup - const string profileOneName = "SimpleProfile.sti"; - const string profileTwoName = "Tutorial-1a 10.1.4.3.sti"; + const string profileOneName = "SimpleProfile.stix"; + const string profileTwoName = "Tutorial-1a.stix"; Segment segment = CreateSegmentWithProfiles(new[] { profileOneName, @@ -96,38 +95,44 @@ }); // Call - IEnumerable soilProfiles = SoilProfile2DImporter.Import(StiTestDataFolder, segment, availableSoils, null); + IEnumerable soilProfiles = SoilProfile2DImporter.Import(stixTestDataFolder, segment, availableSoils, null); // Assert Assert.That(soilProfiles.Count, Is.EqualTo(2)); SoilProfile2D soilProfileOne = soilProfiles.ElementAt(0); - Assert.That(soilProfileOne.Name, Is.EqualTo(profileOneName)); - Assert.That(soilProfileOne.Surfaces.Select(s => s.Name), Is.EqualTo(new[] + Assert.Multiple(() => { - "Soft Clay", - "Muck" - }).AsCollection); + Assert.That(soilProfileOne.Name, Is.EqualTo(profileOneName)); + Assert.That(soilProfileOne.Surfaces.Select(s => s.Name), Is.EqualTo(new[] + { + "Soft Clay", + "Muck" + }).AsCollection); + }); AssertSoilLayerProperties(soilProfileOne.Surfaces); SoilProfile2D soilProfileTwo = soilProfiles.ElementAt(1); - Assert.That(soilProfileTwo.Name, Is.EqualTo(profileTwoName)); - Assert.That(soilProfileTwo.Surfaces.Select(s => s.Name), Is.EquivalentTo(new[] + Assert.Multiple(() => { - "Soft Clay", - "Sand", - "Peat", - "Soft Clay" - })); // Check only whether all the surfaces are present as the order differs on different machines. + Assert.That(soilProfileTwo.Name, Is.EqualTo(profileTwoName)); + Assert.That(soilProfileTwo.Surfaces.Select(s => s.Name), Is.EquivalentTo(new[] + { + "Soft Clay", + "Sand", + "Peat", + "Soft Clay" + })); // Check only whether all the surfaces are present as the order differs on different machines. + }); AssertSoilLayerProperties(soilProfileTwo.Surfaces); } - [Test, Ignore("Is sti based, maybe replace with a test that uses stix files")] + [Test] public void Import_WithProfileNamesNotHavingStiExtension_ReturnsExpectedSoilProfiles() { // Setup const string profileOneFileName = "SimpleProfile"; - const string profileTwoFileName = "Tutorial-1a 10.1.4.3"; + const string profileTwoFileName = "Tutorial-1a"; Segment segment = CreateSegmentWithProfiles(new[] { profileOneFileName, @@ -142,40 +147,46 @@ }); // Call - IEnumerable soilProfiles = SoilProfile2DImporter.Import(StiTestDataFolder, segment, availableSoils, null); + IEnumerable soilProfiles = SoilProfile2DImporter.Import(stixTestDataFolder, segment, availableSoils, null); // Assert Assert.That(soilProfiles.Count, Is.EqualTo(2)); SoilProfile2D soilProfileOne = soilProfiles.ElementAt(0); - Assert.That(soilProfileOne.Name, Is.EqualTo(profileOneFileName)); - Assert.That(soilProfileOne.Surfaces.Select(s => s.Name), Is.EqualTo(new[] + Assert.Multiple(() => { - "Soft Clay", - "Muck" - }).AsCollection); + Assert.That(soilProfileOne.Name, Is.EqualTo(profileOneFileName + ".stix")); + Assert.That(soilProfileOne.Surfaces.Select(s => s.Name), Is.EqualTo(new[] + { + "Soft Clay", + "Muck" + }).AsCollection); + }); AssertSoilLayerProperties(soilProfileOne.Surfaces); SoilProfile2D soilProfileTwo = soilProfiles.ElementAt(1); - Assert.That(soilProfileTwo.Name, Is.EqualTo(profileTwoFileName)); - Assert.That(soilProfileTwo.Surfaces.Select(s => s.Name), Is.EquivalentTo(new[] + Assert.Multiple(() => { - "Soft Clay", - "Sand", - "Peat", - "Soft Clay" - })); // Check only whether all the surfaces are present as the order differs on different machines. + Assert.That(soilProfileTwo.Name, Is.EqualTo(profileTwoFileName + ".stix")); + Assert.That(soilProfileTwo.Surfaces.Select(s => s.Name), Is.EquivalentTo(new[] + { + "Soft Clay", + "Sand", + "Peat", + "Soft Clay" + })); // Check only whether all the surfaces are present as the order differs on different machines. + }); AssertSoilLayerProperties(soilProfileTwo.Surfaces); } - [Test, Ignore("Is sti based, maybe replace with a test that uses stix files")] + [Test] public void Import_WithIncompleteSoilList_ThrowsSoilProfileImporterException() { - const string invalidSoilProfile = "Tutorial-1a 10.1.4.3.sti"; // Soil profile also contains peat and sand for its layers + const string invalidSoilProfile = "Tutorial-1a.stix"; // Soil profile also contains peat and sand for its layers const string profileName = "SimpleProfile"; Segment segment = CreateSegmentWithProfiles(new[] { - $"{profileName}.sti", + $"{profileName}.stix", invalidSoilProfile }); SoilList availableSoils = CreateSoilList(new[] @@ -184,17 +195,17 @@ "Muck" }); - Assert.That(() => SoilProfile2DImporter.Import(StiTestDataFolder, segment, availableSoils, null), + Assert.That(() => SoilProfile2DImporter.Import(stixTestDataFolder, segment, availableSoils, null), Throws.Exception.TypeOf().With.Message.EqualTo($"'{invalidSoilProfile}' contains the undefined soil: Sand.")); } - [Test, Ignore("Is sti based, maybe replace with a test that uses stix files")] + [Test] public void Import_WithSoilProfileCausingReadException_ThrowsSoilProfileImporterException() { const string invalidSoilProfileName = "NonExistentSoilProfile"; Segment segment = CreateSegmentWithProfiles(new[] { - "SimpleProfile.sti", + "SimpleProfile.stix", invalidSoilProfileName }); SoilList availableSoils = CreateSoilList(new[] @@ -203,7 +214,7 @@ "Muck" }); - Assert.That(() => SoilProfile2DImporter.Import(StiTestDataFolder, segment, availableSoils, null), + Assert.That(() => SoilProfile2DImporter.Import(stixTestDataFolder, segment, availableSoils, null), Throws.TypeOf().With.Message.Contains($"Could not import soil profile '{invalidSoilProfileName}': ")); } @@ -258,7 +269,7 @@ public void WhenImported_ThenSoilProfile2DHasValidGeometry(double xSoilProfile2DOrigin) { // Call - List soilProfiles = SoilProfile2DImporter.Import(StixTestDataFolder, segment, + List soilProfiles = SoilProfile2DImporter.Import(stixTestDataFolder, segment, availableSoils, aquifers, xSoilProfile2DOrigin).ToList(); // Assert @@ -278,7 +289,7 @@ public void WhenImported_ThenAquifersAreSetAsExpected() { // Call - List soilProfiles = SoilProfile2DImporter.Import(StixTestDataFolder, segment, availableSoils, aquifers).ToList(); + List soilProfiles = SoilProfile2DImporter.Import(stixTestDataFolder, segment, availableSoils, aquifers).ToList(); // Assert Assert.That(soilProfiles, Has.Count.EqualTo(2)); Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Deltares.Dam.Tests.csproj =================================================================== diff -u -r5968 -r5988 --- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Deltares.Dam.Tests.csproj (.../Deltares.Dam.Tests.csproj) (revision 5968) +++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/Deltares.Dam.Tests.csproj (.../Deltares.Dam.Tests.csproj) (revision 5988) @@ -50,6 +50,12 @@ ..\..\..\lib\DamEngine\DGeoSuite.Components.Persistence.dll + + PreserveNewest + + + PreserveNewest + Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/TestData/Geometry2DImporter/Tutorial-1a.stix =================================================================== diff -u Binary files differ