Index: Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Importers/WaveConditionsCalculationConfigurationImporterTest.cs =================================================================== diff -u -r3fa1f22b25a81f42d033e29e29d57e362eff8662 -r911577ed4bdd54ed724e39b8c221d5aa21510295 --- Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Importers/WaveConditionsCalculationConfigurationImporterTest.cs (.../WaveConditionsCalculationConfigurationImporterTest.cs) (revision 3fa1f22b25a81f42d033e29e29d57e362eff8662) +++ Ringtoets/Revetment/test/Ringtoets.Revetment.IO.Test/Importers/WaveConditionsCalculationConfigurationImporterTest.cs (.../WaveConditionsCalculationConfigurationImporterTest.cs) (revision 911577ed4bdd54ed724e39b8c221d5aa21510295) @@ -114,7 +114,7 @@ // Assert string expectedMessage = $"{expectedErrorMessage} Berekening 'Berekening 1' is overgeslagen."; - TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); + TestHelper.AssertLogMessageWithLevelIsGenerated(call, new Tuple(expectedMessage, LogLevelConstant.Error), 1); Assert.IsTrue(successful); CollectionAssert.IsEmpty(calculationGroup.Children); } @@ -138,7 +138,7 @@ // Assert const string expectedMessage = "De locatie met hydraulische randvoorwaarden 'HRlocatie' bestaat niet. Berekening 'Calculation' is overgeslagen."; - TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); + TestHelper.AssertLogMessageWithLevelIsGenerated(call, new Tuple(expectedMessage, LogLevelConstant.Error), 1); Assert.IsTrue(successful); CollectionAssert.IsEmpty(calculationGroup.Children); } @@ -162,7 +162,7 @@ // Assert const string expectedMessage = "Het voorlandprofiel 'Voorlandprofiel' bestaat niet. Berekening 'Berekening 1' is overgeslagen."; - TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); + TestHelper.AssertLogMessageWithLevelIsGenerated(call, new Tuple(expectedMessage, LogLevelConstant.Error), 1); Assert.IsTrue(successful); CollectionAssert.IsEmpty(calculationGroup.Children); } @@ -186,16 +186,16 @@ // Assert const string expectedMessage = "Er is geen voorlandprofiel opgegeven om golfreductie parameters aan toe te voegen. Berekening 'Berekening 1' is overgeslagen."; - TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); + TestHelper.AssertLogMessageWithLevelIsGenerated(call, new Tuple(expectedMessage, LogLevelConstant.Error), 1); Assert.IsTrue(successful); CollectionAssert.IsEmpty(calculationGroup.Children); } [Test] - public void Import_UseForeshoreButProfileWithoutGeometry_LogMessageAndContinueImport() + public void Import_UseForeshoreTrueButProfileWithoutForeshoreGeometry_LogMessageAndContinueImport() { // Setup - string filePath = Path.Combine(path, "validConfigurationCalculationContainingUseForeshoreForeshoreProfileWithoutGeometry.xml"); + string filePath = Path.Combine(path, "validConfigurationCalculationUseForeshoreTrueForeshoreProfileWithoutGeometry.xml"); var calculationGroup = new CalculationGroup(); var foreshoreProfile = new TestForeshoreProfile("Voorlandprofiel"); @@ -214,12 +214,50 @@ // Assert const string expectedMessage = "Het opgegeven voorlandprofiel 'Voorlandprofiel' heeft geen geometrie en kan daarom niet gebruikt worden. Berekening 'Berekening 1' is overgeslagen."; - TestHelper.AssertLogMessageIsGenerated(call, expectedMessage, 1); + TestHelper.AssertLogMessageWithLevelIsGenerated(call, new Tuple(expectedMessage, LogLevelConstant.Error), 1); Assert.IsTrue(successful); CollectionAssert.IsEmpty(calculationGroup.Children); } [Test] + public void Import_UseForeshoreFalseButProfileWithoutForeshoreGeometry_DataAddedToModel() + { + // Setup + string filePath = Path.Combine(path, "validConfigurationCalculationUseForeshoreFalseForeshoreProfileWithoutGeometry.xml"); + + var calculationGroup = new CalculationGroup(); + var foreshoreProfile = new TestForeshoreProfile("Voorlandprofiel"); + var importer = new WaveConditionsCalculationConfigurationImporter( + filePath, + calculationGroup, + Enumerable.Empty(), + new[] + { + foreshoreProfile + }); + + // Call + bool successful = importer.Import(); + + // Assert + Assert.IsTrue(successful); + + var expectedCalculation = new SimpleWaveConditionsCalculation + { + Name = "Berekening 1", + InputParameters = + { + UseForeshore = false, + Orientation = (RoundedDouble) 0, + ForeshoreProfile = foreshoreProfile + } + }; + + Assert.AreEqual(1, calculationGroup.Children.Count); + AssertWaveConditionsCalculation(expectedCalculation, (IWaveConditionsCalculation)calculationGroup.Children[0]); + } + + [Test] public void Import_ValidConfigurationWithValidData_DataAddedToModel() { // Setup