// Copyright (C) Stichting Deltares 2018. All rights reserved. // // This file is part of the Dam Macrostability Kernel. // // The Dam Macrostability Kernel is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero 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 Affero General Public License for more details. // // You should have received a copy of the GNU Affero 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 System.IO; using System.Linq; using Deltares.DamMacroStability.Calculator; using NUnit.Framework; namespace Deltares.DamMacroStability.CalculatorTests { [TestFixture] public class DGeoStabilityResultReaderTests { private const string TestFolder = @"..\..\Tests\Files"; private const string TestReadFolder = @"..\..\Tests\Files\ReadFolder"; private const string TestEmptyFolder = @"..\..\Tests\Files\NoInputFilesInThisFolder"; private const string TestFileInput = @"result NoUplift.sti"; private const string TestFileOutput = @"result NoUplift.std"; private const string TestFileInputNoOutput = @"result NoOutput.sti"; private const string TestFileInputNoOutputWithErrorFile = @"result NoOutput WithErrorFile.sti"; private const string TestFileUplift = @"result Uplift.std"; private const string TestFileWithZonePlot = @"damWithZonePlotEnabled.std"; private const string TestFileWithZonePlotUplift = @"damWithZonePlotEnabledUplift.std"; [Test] public void TestReadSafetyFactor() { var inputFileName = Path.Combine(TestFolder, TestFileInput); var results = DGeoStabilityResultReader.ExtractStabilityResults(inputFileName); Assert.AreEqual(1, results.Count); Assert.AreEqual(1.276, results[0].Zone1.SafetyFactor, 0.001); } [Test] public void TestReadSafetyFactorsFromFolder() { var results = DGeoStabilityResultReader.ExtractStabilityResults(TestReadFolder); Assert.AreEqual(2, results.Count); Assert.AreEqual(1.276, results.First(r => r.CalculationName == "TestBishop").Zone1.SafetyFactor, 0.001); Assert.AreEqual(1.287, results.First(r => r.CalculationName == "TestUpliftVan").Zone1.SafetyFactor, 0.001); } [Test] public void TestCanParseStringContentWhenSafetyFactorIsInFirstColumn() { var contents = @" 28.237 28.850 23.786 2.324 " + Environment.NewLine + @"[End of CircleResults]" + Environment.NewLine + Environment.NewLine + @"[Dumps]" + Environment.NewLine + @" 1 : number of dumps in file" + Environment.NewLine + Environment.NewLine + @"[Dump]" + Environment.NewLine + @"[Dump Header]" + Environment.NewLine + @"[Column Indication]" + Environment.NewLine + @"Stability factor" + Environment.NewLine + @"Number of slices" + Environment.NewLine + @"X-Centrepoint" + Environment.NewLine + @"Y-Centrepoint" + Environment.NewLine + @"Radius" + Environment.NewLine + @"X coordinate left surface" + Environment.NewLine + @"X coordinate right surface" + Environment.NewLine + @"Dump name" + Environment.NewLine + @"[End of Column Indication]" + Environment.NewLine + @"[Data]" + Environment.NewLine + @" 1.276 35 18.216 21.971 12.907 12.907 17.810 Design level" + Environment.NewLine + @"[End of Data]" + Environment.NewLine + @"[End Of Dump Header]" + Environment.NewLine + @"[SliceGeometry]" + Environment.NewLine + @"[Column Indication]" + @"[MODEL]" + Environment.NewLine + @" 1 : Bishop" + Environment.NewLine; var result = DGeoStabilityResultReader.GetDGeoStabilityResults(contents); Assert.AreEqual(1.276, result.Zone1.SafetyFactor, 0.001); } [Test] public void TestCanParseStringContentWhenSafetyFactorIsInOtherColumn() { var contents = @" 28.237 28.850 23.786 2.324 " + Environment.NewLine + @"[End of CircleResults]" + Environment.NewLine + Environment.NewLine + @"[Dumps]" + Environment.NewLine + @" 1 : number of dumps in file" + Environment.NewLine + Environment.NewLine + @"[Dump]" + Environment.NewLine + @"[Dump Header]" + Environment.NewLine + @"[Column Indication]" + Environment.NewLine + @"Number of slices" + Environment.NewLine + @"X-Centrepoint" + Environment.NewLine + @"Y-Centrepoint" + Environment.NewLine + @"Stability factor" + Environment.NewLine + @"Radius" + Environment.NewLine + @"X coordinate left surface" + Environment.NewLine + @"X coordinate right surface" + Environment.NewLine + @"Dump name" + Environment.NewLine + @"[End of Column Indication]" + Environment.NewLine + @"[Data]" + Environment.NewLine + @" 1.276 35 18.216 21.971 12.907 12.907 17.810 Design level" + Environment.NewLine + @"[End of Data]" + Environment.NewLine + @"[End Of Dump Header]" + Environment.NewLine + @"[SliceGeometry]" + Environment.NewLine + @"[Column Indication]" + @"[MODEL]" + Environment.NewLine + @" 1 : Bishop" + Environment.NewLine; var result = DGeoStabilityResultReader.GetDGeoStabilityResults(contents); Assert.AreEqual(21.971, result.Zone1.SafetyFactor, 0.001); } [Test] public void TestCanParseFileContentsStability() { var fileName = Path.Combine(TestFolder, TestFileOutput); var contents = DGeoStabilityResultReader.GetFileContents(fileName); var result = DGeoStabilityResultReader.GetDGeoStabilityResults(contents); Assert.AreEqual(1.276, result.Zone1.SafetyFactor, 0.001); Assert.AreEqual(26.091, result.Zone1.CircleSurfacePointRightXCoordinate, 0.001); } [Test] public void TestCorrectionSafetyFactorForUplift() { var fileName = Path.Combine(TestFolder, TestFileUplift); var contents = DGeoStabilityResultReader.GetFileContents(fileName); var result = DGeoStabilityResultReader.GetDGeoStabilityResults(contents); Assert.AreEqual(1.276, result.Zone1.SafetyFactor, 0.001); } [Test] public void TestCorrectionSafetyFactorForUpliftWithZone() { var fileName = Path.Combine(TestFolder, TestFileWithZonePlotUplift); var contents = DGeoStabilityResultReader.GetFileContents(fileName); var result = DGeoStabilityResultReader.ParseZoneResults(contents, (int)DGeoStabilityResultReader.StabilityZone.StabilityZone1a); Assert.IsTrue(result != null); var safetyFactor = ((DGeoStabilityResultReader.DGeoStabilityResultsSingleZone)result).SafetyFactor; Assert.AreEqual(1.104, safetyFactor, 0.001); } [Test] public void TestValidateIfFileContentsHasZonePlotEnabled() { var fileName = Path.Combine(TestFolder, TestFileWithZonePlot); var contents = DGeoStabilityResultReader.GetFileContents(fileName); var result = DGeoStabilityResultReader.ParseHasZonePlotEnabled(contents); Assert.IsTrue(result); } [Test] public void TestFileContentsHasZonePlotDisabled() { var zonePlotOff = @"[MODEL]" + Environment.NewLine + @" 1 : Bishop" + Environment.NewLine + @" 1 : C phi" + Environment.NewLine + @" 0 : Probabilistic off" + Environment.NewLine + @" 1 : Mean" + Environment.NewLine + @" 0 : Geotextiles off" + Environment.NewLine + @" 0 : Nails off" + Environment.NewLine + @" 0 : Zone plot on" + Environment.NewLine + @" 0 : Local measurements" + Environment.NewLine + @"[END OF MODEL]" + Environment.NewLine; var actualZonePlot = DGeoStabilityResultReader.ParseHasZonePlotEnabled(zonePlotOff); var expectedZonePlot = false; Assert.AreEqual(actualZonePlot, expectedZonePlot); } [Test] public void TestFileContentsHasZonePlotZone1bAndZone2b() { var testWithZonePlot1bAnd2b = @"[MODEL]" + Environment.NewLine + @" 1 : Bishop" + Environment.NewLine + @" 1 : C phi" + Environment.NewLine + @" 0 : Probabilistic off" + Environment.NewLine + @" 1 : Mean" + Environment.NewLine + @" 0 : Geotextiles off" + Environment.NewLine + @" 0 : Nails off" + Environment.NewLine + @" 1 : Zone plot on" + Environment.NewLine + @" 0 : Local measurements" + Environment.NewLine + @"[END OF MODEL]" + Environment.NewLine + @"[Dump]" + Environment.NewLine + @"[Dump Header]" + Environment.NewLine + @"[Column Indication]" + Environment.NewLine + @"Stability factor" + Environment.NewLine + @"Number of slices" + Environment.NewLine + @"X-Centrepoint" + Environment.NewLine + @"Y-Centrepoint" + Environment.NewLine + @"Radius" + Environment.NewLine + @"X coordinate left surface" + Environment.NewLine + @"X coordinate right surface" + Environment.NewLine + @"Zone number" + Environment.NewLine + @"Dump name" + Environment.NewLine + @"[End of Column Indication]" + Environment.NewLine + @"[Data]" + Environment.NewLine + @" 1.234 35 46.429 7.714 11.357 17.810 24.310 2 Design level" + Environment.NewLine + @"[End of Data]" + Environment.NewLine + @"[End Of Dump Header]" + Environment.NewLine + @"[Dump]" + Environment.NewLine + @"[Dump Header]" + Environment.NewLine + @"[Column Indication]" + Environment.NewLine + @"Stability factor" + Environment.NewLine + @"Number of slices" + Environment.NewLine + @"X-Centrepoint" + Environment.NewLine + @"Y-Centrepoint" + Environment.NewLine + @"Radius" + Environment.NewLine + @"X coordinate left surface" + Environment.NewLine + @"X coordinate right surface" + Environment.NewLine + @"Zone number" + Environment.NewLine + @"Dump name" + Environment.NewLine + @"[End of Column Indication]" + Environment.NewLine + @"[Data]" + Environment.NewLine + @" 1.345 35 46.429 7.714 11.357 19.810 26.310 4 Design level" + Environment.NewLine + @"[End of Data]" + Environment.NewLine + @"[End Of Dump Header]" + Environment.NewLine; var actualMStabResults = DGeoStabilityResultReader.GetDGeoStabilityResults(testWithZonePlot1bAnd2b); var expectedStabilityZone1 = new DGeoStabilityResultReader.DGeoStabilityResultsSingleZone(); var expectedStabilityZone2 = new DGeoStabilityResultReader.DGeoStabilityResultsSingleZone(); expectedStabilityZone1.SafetyFactor = 1.234; expectedStabilityZone1.CircleSurfacePointLeftXCoordinate = 17.810; expectedStabilityZone1.CircleSurfacePointRightXCoordinate = 24.310; expectedStabilityZone2.SafetyFactor = 1.345; expectedStabilityZone2.CircleSurfacePointLeftXCoordinate = 19.810; expectedStabilityZone2.CircleSurfacePointRightXCoordinate = 26.310; Assert.IsNotNull(actualMStabResults); Assert.AreEqual(expectedStabilityZone1.SafetyFactor, actualMStabResults.Zone1.SafetyFactor, 0.001); Assert.AreEqual(expectedStabilityZone1.CircleSurfacePointRightXCoordinate, actualMStabResults.Zone1.CircleSurfacePointRightXCoordinate, 0.001); Assert.IsNotNull(actualMStabResults.Zone2); Assert.AreEqual(expectedStabilityZone2.SafetyFactor, actualMStabResults.Zone2.Value.SafetyFactor, 0.001); Assert.AreEqual(expectedStabilityZone2.CircleSurfacePointRightXCoordinate, actualMStabResults.Zone2.Value.CircleSurfacePointRightXCoordinate, 0.001); } [Test] public void TestCanParseFileHasStabilityFactorZone() { var fileName = Path.Combine(TestFolder, TestFileWithZonePlot); var contents = DGeoStabilityResultReader.GetFileContents(fileName); var result = DGeoStabilityResultReader.GetDGeoStabilityResults(contents); Assert.AreEqual(1.104, result.Zone1.SafetyFactor, 0.001); } [Test] public void TestInitStructs() { var results = new DGeoStabilityResultReader.DGeoStabilityResults(); results.Init(); var zone = results.Zone1; Assert.AreEqual(zone.SafetyFactor, 0.0, 0.01); Assert.AreEqual(zone.CircleSurfacePointLeftXCoordinate, 0.0, 0.01); Assert.AreEqual(zone.CircleSurfacePointRightXCoordinate, 0.0, 0.01); Assert.IsTrue(results.Zone2 != null); zone = (DGeoStabilityResultReader.DGeoStabilityResultsSingleZone) results.Zone2; Assert.AreEqual(zone.SafetyFactor, 0.0, 0.01); Assert.AreEqual(zone.CircleSurfacePointLeftXCoordinate, 0.0, 0.01); Assert.AreEqual(zone.CircleSurfacePointRightXCoordinate, 0.0, 0.01); } #region Exceptions [Test] [ExpectedException(typeof(ArgumentException), ExpectedMessage = "Uitvoerbestand '' heeft geen inhoud")] [SetUICulture("nl-NL")] public void TestLanguageNlThrowsExceptionWhenFileHasNoContent() { DGeoStabilityResultReader.GetDGeoStabilityResults(""); } [Test] [ExpectedException(typeof(ArgumentException), ExpectedMessage = "Output file '' has no content")] [SetUICulture("en-US")] public void TestLanguageEnThrowsExceptionWhenFileHasNoContent() { DGeoStabilityResultReader.GetDGeoStabilityResults(""); } [Test] [ExpectedException(typeof(ArgumentException))] public void TestThrowsExceptionWhenFileHasContentIsNull() { DGeoStabilityResultReader.GetDGeoStabilityResults(null); } [Test] [ExpectedException(typeof(ArgumentException))] public void TestThrowsExceptionWhenFileContainsOnlySpaces() { DGeoStabilityResultReader.GetDGeoStabilityResults(" "); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException))] public void TestThrowIfDumpsHeaderNotFoundInContent() { var contents = " 8.30 " + Environment.NewLine; contents += " [Dumps] " + Environment.NewLine; contents += " test "; contents += "[Data]" + Environment.NewLine; contents += " 1.276 35 18.216 21.971 12.907 Design level"; DGeoStabilityResultReader.GetDGeoStabilityResults(contents); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException))] public void TestThrowIfDumpHeaderNotFoundInContent() { var contents = " 8.30 " + Environment.NewLine; contents += " test "; contents += "[Data]" + Environment.NewLine; contents += " 1.276 35 18.216 21.971 12.907 Design level"; DGeoStabilityResultReader.GetDGeoStabilityResults(contents); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException))] public void TestThrowIfDataHeaderNotFoundInContent() { var contents = " 8.30 " + Environment.NewLine; contents += "[Dump]" + Environment.NewLine; contents += " test "; contents += "[iets]" + Environment.NewLine; contents += " 1.276 35 18.216 21.971 12.907 Design level"; DGeoStabilityResultReader.GetDGeoStabilityResults(contents); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException))] public void TestThrowIfStabilityColumnNotFound() { var contents = @" 28.237 28.850 23.786 2.324 " + Environment.NewLine + @"[End of CircleResults]" + Environment.NewLine + Environment.NewLine + @"[Dumps]" + Environment.NewLine + @" 1 : number of dumps in file" + Environment.NewLine + Environment.NewLine + @"[Dump]" + Environment.NewLine + @"[Dump Header]" + Environment.NewLine + @"[Column Indication]" + Environment.NewLine + //@"Stability factor" + Environment.NewLine + @"Number of slices" + Environment.NewLine + @"X-Centrepoint" + Environment.NewLine + @"Y-Centrepoint" + Environment.NewLine + @"Radius" + Environment.NewLine + @"X coordinate left surface" + Environment.NewLine + @"X coordinate right surface" + Environment.NewLine + @"Dump name" + Environment.NewLine + @"[End of Column Indication]" + Environment.NewLine + @"[Data]" + Environment.NewLine + @" 1.276 35 18.216 21.971 12.907 12.907 17.810 Design level" + Environment.NewLine + @"[End of Data]" + Environment.NewLine + @"[End Of Dump Header]" + Environment.NewLine + @"[SliceGeometry]" + Environment.NewLine + @"[Column Indication]"; DGeoStabilityResultReader.GetDGeoStabilityResults(contents); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException))] public void TestThrowIfExitPointXCoordinateColumnNotFound() { var contents = @" 28.237 28.850 23.786 2.324 " + Environment.NewLine + @"[End of CircleResults]" + Environment.NewLine + Environment.NewLine + @"[Dumps]" + Environment.NewLine + @" 1 : number of dumps in file" + Environment.NewLine + Environment.NewLine + @"[Dump]" + Environment.NewLine + @"[Dump Header]" + Environment.NewLine + @"[Column Indication]" + Environment.NewLine + @"Stability factor" + Environment.NewLine + @"Number of slices" + Environment.NewLine + @"X-Centrepoint" + Environment.NewLine + @"Y-Centrepoint" + Environment.NewLine + @"Radius" + Environment.NewLine + // @"X coordinate right surface" + Environment.NewLine + @"Dump name" + Environment.NewLine + @"[End of Column Indication]" + Environment.NewLine + @"[Data]" + Environment.NewLine + @" 1.276 35 18.216 21.971 12.907 17.810 Design level" + Environment.NewLine + @"[End of Data]" + Environment.NewLine + @"[End Of Dump Header]" + Environment.NewLine + @"[SliceGeometry]" + Environment.NewLine + @"[Column Indication]"; DGeoStabilityResultReader.GetDGeoStabilityResults(contents); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException))] public void TestThrowIfStabilityColumnCouldntBeParsed() { var contents = @" 28.237 28.850 23.786 2.324 " + Environment.NewLine + @"[End of CircleResults]" + Environment.NewLine + Environment.NewLine + @"[Dumps]" + Environment.NewLine + @" 1 : number of dumps in file" + Environment.NewLine + Environment.NewLine + @"[Dump]" + Environment.NewLine + @"[Dump Header]" + Environment.NewLine + @"[Column Indication]" + Environment.NewLine + @"Stability factor " + @"Number of slices " + @"X-Centrepoint " + @"Y-Centrepoint " + @"Radius " + @"X coordinate left surface" + Environment.NewLine + @"X coordinate right surface" + Environment.NewLine + @"Dump name " + @"[End of Column Indication]" + Environment.NewLine + @"[Data]" + Environment.NewLine + @" 1.276 35 18.216 21.971 12.907 12.907 17.810 Design level" + Environment.NewLine + @"[End of Data]" + Environment.NewLine + @"[End Of Dump Header]" + Environment.NewLine + @"[SliceGeometry]" + Environment.NewLine + @"[Column Indication]"; DGeoStabilityResultReader.GetDGeoStabilityResults(contents); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException))] public void TestThrowIfExitPointXCoordinateColumnCouldntBeParsed() { var contents = @" 28.237 28.850 23.786 2.324 " + Environment.NewLine + @"[End of CircleResults]" + Environment.NewLine + Environment.NewLine + @"[Dumps]" + Environment.NewLine + @" 1 : number of dumps in file" + Environment.NewLine + Environment.NewLine + @"[Dump]" + Environment.NewLine + @"[Dump Header]" + Environment.NewLine + @"[Column Indication]" + Environment.NewLine + @"Stability factor " + @"Number of slices " + @"X-Centrepoint " + @"Y-Centrepoint " + @"Radius " + @"X coordinate right surface" + Environment.NewLine + @"Dump name " + @"[End of Column Indication]" + Environment.NewLine + @"[Data]" + Environment.NewLine + @" 1.276 35 18.216 21.971 12.907 17.810 Design level" + Environment.NewLine + @"[End of Data]" + Environment.NewLine + @"[End Of Dump Header]" + Environment.NewLine + @"[SliceGeometry]" + Environment.NewLine + @"[Column Indication]"; DGeoStabilityResultReader.GetDGeoStabilityResults(contents); } [Test] [ExpectedException(typeof(ArgumentException))] public void TestThrowIfOuputFileNameEmpty() { DGeoStabilityResultReader.GetFileContents(""); } [Test] [ExpectedException(typeof(ArgumentException))] public void TestThrowIfOuputFileNameIsNull() { DGeoStabilityResultReader.GetFileContents(null); } [Test] [ExpectedException(typeof(ArgumentException))] public void TestThrowIfOuputFileNameContainsSpaces() { DGeoStabilityResultReader.GetFileContents(""); } [Test] [ExpectedException(typeof(FileNotFoundException))] public void TestThrowIfOuputFileNotFoundAtGetFileContents() { DGeoStabilityResultReader.GetFileContents("test.std"); } [Test] [ExpectedException(typeof(FileNotFoundException))] public void TestThrowIfOuputFileNotFoundAtParseResultsFromOutputFile() { DGeoStabilityResultReader.ParseResultsFromOutputFile("test.std"); } [Test] [ExpectedException(typeof(DirectoryNotFoundException))] public void TestThrowIfFolderDoesNotExist() { DGeoStabilityResultReader.ExtractStabilityResults("NonExistingFolder"); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException), ExpectedMessage = "Geen resultaten gevonden in '..\\..\\Tests\\Files\\NoInputFilesInThisFolder'")] [SetUICulture("nl-NL")] public void TestThrowIfNoResultsFound() { DGeoStabilityResultReader.ExtractStabilityResults(TestEmptyFolder); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException), ExpectedMessage = "Stabiliteitszone 1a of 1b zou moeten bestaan")] [SetUICulture("nl-NL")] public void TestThrowIfZoneResults1DoNotExistInFileContent() { var contents = @" 1 : Zone plot on" + Environment.NewLine; DGeoStabilityResultReader.GetDGeoStabilityResults(contents); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException), ExpectedMessage = "Kan kolom identificatie niet lezen")] [SetUICulture("nl-NL")] public void TestThrowIfCouldNotReadColumnIndication() { var contents = @" 1 : Zone plot on" + Environment.NewLine + @"[Dump]"; DGeoStabilityResultReader.ParseZoneResults(contents, (int) DGeoStabilityResultReader.StabilityZone.StabilityZone2a); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException), ExpectedMessage = "Zone nummer of stabiliteitsfactor niet gevonden")] [SetUICulture("nl-NL")] public void TestThrowIfIndicesWereNotFound() { string fileName = Path.Combine(TestFolder, "damCorruptFactorsMissing.std"); var contents = DGeoStabilityResultReader.GetFileContents(fileName); DGeoStabilityResultReader.ParseZoneResults(contents, (int) DGeoStabilityResultReader.StabilityZone.StabilityZone2a); } [Test] [SetUICulture("nl-NL")] public void TestThrowIfParsingZoneResultsFails() { // It is not possible to check the ExpectedMessage here because it contains code information like line number etc. var fileName = Path.Combine(TestFolder, "damCorruptParsingZonePlot.std"); var contents = DGeoStabilityResultReader.GetFileContents(fileName); try { DGeoStabilityResultReader.ParseZoneResults(contents, (int)DGeoStabilityResultReader.StabilityZone.StabilityZone2a); } catch (Exception e) { Assert.IsTrue(e.Message.Contains("Kan zone results niet inlezen: ")); } } [Test] [ExpectedException(typeof(ArgumentException), ExpectedMessage = "Project filenaam '' is niet geldig")] [SetUICulture("nl-NL")] public void TestThrowsExceptionWhenProjectHasNoValidName() { DGeoStabilityResultReader.ExtractStabilityResult(""); } [Test] [ExpectedException(typeof(FileNotFoundException), ExpectedMessage = "Projectfile 'NonExistingFile.sti' niet gevonden")] [SetUICulture("nl-NL")] public void TestThrowsExceptionWhenProjectDoesNotExist() { DGeoStabilityResultReader.ExtractStabilityResult("NonExistingFile.sti"); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException), ExpectedMessage = "Kan geen veiligheidsfactor afleiden")] [SetUICulture("nl-NL")] public void TestThrowsExceptionWhenInputFileExistsButNoOuputFile() { var inputFileName = Path.Combine(TestFolder, TestFileInputNoOutput); DGeoStabilityResultReader.ExtractStabilityResult(inputFileName); } [Test] [ExpectedException(typeof(DGeoStabilityResultReaderException), ExpectedMessage = "Een betrouwbaarheidsanalyse in combinatie met model \"Su berekend DOV\" is (nog) niet mogelijk. Selecteer alstublieft een ander schuifspanningsmodel.")] [SetUICulture("nl-NL")] public void TestThrowsExceptionWhenInputFileExistsButNoOuputFileWithErrorFile() { var inputFileName = Path.Combine(TestFolder, TestFileInputNoOutputWithErrorFile); DGeoStabilityResultReader.ExtractStabilityResult(inputFileName); } #endregion } }