Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/Exporters/AssemblyExporter.cs
===================================================================
diff -u -ra71b1ceb1838d97cabf3abad83710ce49f9dced9 -r1278f5e294a4dd194391fbcfe91f54546e20e1de
--- Ringtoets/Integration/src/Ringtoets.Integration.IO/Exporters/AssemblyExporter.cs (.../AssemblyExporter.cs) (revision a71b1ceb1838d97cabf3abad83710ce49f9dced9)
+++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Exporters/AssemblyExporter.cs (.../AssemblyExporter.cs) (revision 1278f5e294a4dd194391fbcfe91f54546e20e1de)
@@ -28,6 +28,7 @@
using Ringtoets.AssemblyTool.IO;
using Ringtoets.Common.Data.Exceptions;
using Ringtoets.Integration.Data;
+using Ringtoets.Integration.Data.Assembly;
using Ringtoets.Integration.IO.Assembly;
using Ringtoets.Integration.IO.Creators;
using Ringtoets.Integration.IO.Exceptions;
@@ -67,6 +68,8 @@
public bool Export()
{
+ CheckManualAssembly();
+
ExportableAssessmentSection exportableAssessmentSection = CreateExportableAssessmentSection();
if (!ValidateExportableAssessmentSection(exportableAssessmentSection))
{
@@ -93,6 +96,14 @@
return true;
}
+ private void CheckManualAssembly()
+ {
+ if (AssessmentSectionHelper.HasManualAssemblyResults(assessmentSection))
+ {
+ log.Warn(Resources.AssemblyExporter_CheckManualAssembly_Assembly_result_contains_manual_results_exporter_will_ignore_manual_results);
+ }
+ }
+
private ExportableAssessmentSection CreateExportableAssessmentSection()
{
try
Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/Properties/Resources.Designer.cs
===================================================================
diff -u -r4d38df69c95e64608027c29e7259bfaf4a068727 -r1278f5e294a4dd194391fbcfe91f54546e20e1de
--- Ringtoets/Integration/src/Ringtoets.Integration.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 4d38df69c95e64608027c29e7259bfaf4a068727)
+++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1278f5e294a4dd194391fbcfe91f54546e20e1de)
@@ -82,6 +82,16 @@
}
///
+ /// Looks up a localized string similar to Veiligheidsoordeel is (deels) gebaseerd op handmatig ingevoerde toetsoordelen. Tijdens het exporteren worden handmatig ingevoerde toetsoordelen genegeerd..
+ ///
+ internal static string AssemblyExporter_CheckManualAssembly_Assembly_result_contains_manual_results_exporter_will_ignore_manual_results {
+ get {
+ return ResourceManager.GetString("AssemblyExporter_CheckManualAssembly_Assembly_result_contains_manual_results_expo" +
+ "rter_will_ignore_manual_results", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to {0} Er is geen toetsoordeel geƫxporteerd..
///
internal static string AssemblyExporter_Error_Exception_0_no_AssemblyResult_exported {
Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/Properties/Resources.resx
===================================================================
diff -u -r4d38df69c95e64608027c29e7259bfaf4a068727 -r1278f5e294a4dd194391fbcfe91f54546e20e1de
--- Ringtoets/Integration/src/Ringtoets.Integration.IO/Properties/Resources.resx (.../Resources.resx) (revision 4d38df69c95e64608027c29e7259bfaf4a068727)
+++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Properties/Resources.resx (.../Resources.resx) (revision 1278f5e294a4dd194391fbcfe91f54546e20e1de)
@@ -150,4 +150,7 @@
Het is alleen mogelijk een volledig toetsoordeel te exporteren.
+
+ Veiligheidsoordeel is (deels) gebaseerd op handmatig ingevoerde toetsoordelen. Tijdens het exporteren worden handmatig ingevoerde toetsoordelen genegeerd.
+
\ No newline at end of file
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);