Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Exporters/AssemblyExporterTest.cs =================================================================== diff -u -r8f5763187cbd04a1dd8261d2bea61a082840789c -r1278f5e294a4dd194391fbcfe91f54546e20e1de --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Exporters/AssemblyExporterTest.cs (.../AssemblyExporterTest.cs) (revision 8f5763187cbd04a1dd8261d2bea61a082840789c) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Exporters/AssemblyExporterTest.cs (.../AssemblyExporterTest.cs) (revision 1278f5e294a4dd194391fbcfe91f54546e20e1de) @@ -21,6 +21,7 @@ using System; using System.IO; +using System.Linq; using Core.Common.Base.Geometry; using Core.Common.Base.IO; using Core.Common.TestUtil; @@ -138,16 +139,37 @@ } [Test] - public void Export_AssemblyCreateorExceptionThrown_LogsErrorAndReturnsFalse() + public void Export_WithManualAssemblyResult_LogsWarning() { // Setup string filePath = TestHelper.GetScratchPadPath(nameof(Export_InvalidAssessmentSectionCategoryGroupResults_LogsErrorAndReturnsFalse)); AssessmentSection assessmentSection = CreateConfiguredAssessmentSection(); + assessmentSection.Piping.SectionResults.First().UseManualAssemblyProbability = true; var exporter = new AssemblyExporter(assessmentSection, filePath); using (new AssemblyToolCalculatorFactoryConfig()) { + // Call + Action call = () => exporter.Export(); + + // Assert + const string expectedMessage = "Veiligheidsoordeel is (deels) gebaseerd op handmatig ingevoerde toetsoordelen. Tijdens het exporteren worden handmatig ingevoerde toetsoordelen genegeerd."; + TestHelper.AssertLogMessageWithLevelIsGenerated(call, new Tuple(expectedMessage, LogLevelConstant.Warn)); + } + } + + [Test] + public void Export_AssemblyCreatorExceptionThrown_LogsErrorAndReturnsFalse() + { + // Setup + string filePath = TestHelper.GetScratchPadPath(nameof(Export_InvalidAssessmentSectionCategoryGroupResults_LogsErrorAndReturnsFalse)); + AssessmentSection assessmentSection = CreateConfiguredAssessmentSection(); + + var exporter = new AssemblyExporter(assessmentSection, filePath); + + using (new AssemblyToolCalculatorFactoryConfig()) + { var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; FailureMechanismSectionAssemblyCalculatorStub failureMechanismSectionAssemblyCalculator = calculatorFactory.LastCreatedFailureMechanismSectionAssemblyCalculator; failureMechanismSectionAssemblyCalculator.CombinedAssemblyCategoryOutput = FailureMechanismSectionAssemblyCategoryGroup.None; @@ -194,10 +216,10 @@ } [Test] - public void Export_InvalidDirectorRights_LogsErrorAndReturnsFalse() + public void Export_InvalidDirectoryRights_LogsErrorAndReturnsFalse() { // Setup - string filePath = TestHelper.GetScratchPadPath(nameof(Export_InvalidDirectorRights_LogsErrorAndReturnsFalse)); + string filePath = TestHelper.GetScratchPadPath(nameof(Export_InvalidDirectoryRights_LogsErrorAndReturnsFalse)); AssessmentSection assessmentSection = CreateConfiguredAssessmentSection(); var exporter = new AssemblyExporter(assessmentSection, filePath);