Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AddAssessmentSectionCommand.cs
===================================================================
diff -u -r75c007324755a9f899f7fc5639ff873311343bdc -r930dbe6d1d96a17d607c38b7b9600e9147abca44
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AddAssessmentSectionCommand.cs (.../AddAssessmentSectionCommand.cs) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AddAssessmentSectionCommand.cs (.../AddAssessmentSectionCommand.cs) (revision 930dbe6d1d96a17d607c38b7b9600e9147abca44)
@@ -63,7 +63,7 @@
public void Execute(params object[] arguments)
{
- assessmentSectionFromFileCommandHandler.CreateAssessmentSectionFromFile();
+ assessmentSectionFromFileCommandHandler.AddAssessmentSectionFromFile();
}
}
}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AssessmentSectionFromFileCommandHandler.cs
===================================================================
diff -u -r75c007324755a9f899f7fc5639ff873311343bdc -r930dbe6d1d96a17d607c38b7b9600e9147abca44
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AssessmentSectionFromFileCommandHandler.cs (.../AssessmentSectionFromFileCommandHandler.cs) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/AssessmentSectionFromFileCommandHandler.cs (.../AssessmentSectionFromFileCommandHandler.cs) (revision 930dbe6d1d96a17d607c38b7b9600e9147abca44)
@@ -23,7 +23,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
-using Core.Common.Base.Data;
using Core.Common.Gui;
using Core.Common.Gui.Forms.ViewHost;
using Core.Common.IO.Exceptions;
@@ -77,20 +76,21 @@
this.viewController = viewController;
}
- public void CreateAssessmentSectionFromFile()
+ public void AddAssessmentSectionFromFile()
{
- if (!TryValidate())
+ if (!AreSourceFilesValid())
{
return;
}
- var assessmentSection = GetAssessmentSectionFromDialog();
- if (assessmentSection == null || !(projectOwner.Project is RingtoetsProject))
+ AssessmentSection assessmentSection = GetAssessmentSectionFromDialog();
+ RingtoetsProject ringtoetsProject = projectOwner.Project as RingtoetsProject;
+ if (assessmentSection == null || ringtoetsProject == null)
{
return;
}
- SetAssessmentSectionToProject((RingtoetsProject) projectOwner.Project, assessmentSection);
+ SetAssessmentSectionToProject(ringtoetsProject, assessmentSection);
}
#region Dialog
@@ -104,7 +104,7 @@
return null;
}
- var selectedItem = dialog.SelectedReferenceLineMeta;
+ ReferenceLineMeta selectedItem = dialog.SelectedReferenceLineMeta;
return selectedItem == null ? null : CreateAssessmentSection(selectedItem, dialog.SelectedNorm);
}
}
@@ -122,7 +122,6 @@
{
assessmentSection.GrassCoverErosionInwards.GeneralInput.N = n;
assessmentSection.HeightStructures.GeneralInput.N = n;
-
}
private void SetAssessmentSectionToProject(RingtoetsProject ringtoetsProject, AssessmentSection assessmentSection)
@@ -145,14 +144,13 @@
private static AssessmentSection CreateDikeAssessmentSection()
{
- var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike);
- return assessmentSection;
+ return new AssessmentSection(AssessmentSectionComposition.Dike);
}
- private static AssessmentSection CreateDikeAssessmentSection(AssessmentSectionSettings settings)
+ private static AssessmentSection CreateDikeAssessmentSection(int n)
{
var assessmentSection = CreateDikeAssessmentSection();
- SetFailureMechanismsValueN(assessmentSection, settings.N);
+ SetFailureMechanismsValueN(assessmentSection, n);
return assessmentSection;
}
@@ -172,9 +170,9 @@
}
else
{
- assessmentSection = (settingOfSelectedAssessmentSection.IsDune) ?
+ assessmentSection = settingOfSelectedAssessmentSection.IsDune ?
CreateDuneAssessmentSection() :
- CreateDikeAssessmentSection(settingOfSelectedAssessmentSection);
+ CreateDikeAssessmentSection(settingOfSelectedAssessmentSection.N);
}
assessmentSection.Id = selectedItem.AssessmentSectionId;
@@ -203,13 +201,13 @@
#region Validators
- private bool TryValidate()
+ private bool AreSourceFilesValid()
{
- ValidateAssessmentSectionSettings();
+ ReadAssessmentSectionSettings();
try
{
- ValidateReferenceLineMetas();
+ ReadReferenceLineMetas();
}
catch (CriticalFileValidationException exception)
{
@@ -225,7 +223,22 @@
return true;
}
- private void ValidateReferenceLineMetas()
+ ///
+ /// Reads all objects from the shape file located at .
+ ///
+ /// Thrown when:
+ ///
+ /// - points to an invalid directory.
+ /// - The path does not contain any shape files.
+ /// - Thrown when the shape file does not contain poly lines.
+ ///
+ /// Thrown when:
+ ///
+ /// - The shape file does not contain the required attributes.
+ /// - The assessment section ids in the shape file are not unique or are missing.
+ /// - No could be read from the shape file.
+ ///
+ private void ReadReferenceLineMetas()
{
var importer = new ReferenceLineMetaImporter(shapeFileDirectory);
referenceLineMetas = importer.GetReferenceLineMetas();
@@ -236,7 +249,7 @@
}
}
- private void ValidateAssessmentSectionSettings()
+ private void ReadAssessmentSectionSettings()
{
var reader = new AssessmentSectionSettingsReader();
settings = reader.ReadSettings();
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/IAssessmentSectionFromFileCommandHandler.cs
===================================================================
diff -u -r75c007324755a9f899f7fc5639ff873311343bdc -r930dbe6d1d96a17d607c38b7b9600e9147abca44
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/IAssessmentSectionFromFileCommandHandler.cs (.../IAssessmentSectionFromFileCommandHandler.cs) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Commands/IAssessmentSectionFromFileCommandHandler.cs (.../IAssessmentSectionFromFileCommandHandler.cs) (revision 930dbe6d1d96a17d607c38b7b9600e9147abca44)
@@ -20,20 +20,19 @@
// All rights reserved.
using Core.Common.Base.Data;
-using Core.Common.Gui;
-using Ringtoets.Integration.Data;
+using Ringtoets.Common.Data.AssessmentSection;
namespace Ringtoets.Integration.Forms.Commands
{
///
- /// Interface for exposing command related to adding an to an in the .
+ /// Interface for handling commands related to adding to a .
///
public interface IAssessmentSectionFromFileCommandHandler
{
///
- /// Displays a dialog of objects.
- /// If an is selected to import, it is added to the in the .
+ /// Displays available objects to the user and asks to select one.
+ /// The selected , if any, will be added to the .
///
- void CreateAssessmentSectionFromFile();
+ void AddAssessmentSectionFromFile();
}
}
\ No newline at end of file
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs
===================================================================
diff -u -r75c007324755a9f899f7fc5639ff873311343bdc -r930dbe6d1d96a17d607c38b7b9600e9147abca44
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 930dbe6d1d96a17d607c38b7b9600e9147abca44)
@@ -484,7 +484,7 @@
RingtoetsCommonFormsResources.RingtoetsProject_DisplayName,
RingtoetsCommonFormsResources.RingtoetsProject_ToolTip,
GuiResources.PlusIcon,
- (s, e) => assessmentSectionFromFileCommandHandler.CreateAssessmentSectionFromFile());
+ (s, e) => assessmentSectionFromFileCommandHandler.AddAssessmentSectionFromFile());
return Gui.Get(nodeData, treeViewControl)
.AddCustomItem(addItem)
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Commands/AddAssessmentSectionCommandTest.cs
===================================================================
diff -u -r75c007324755a9f899f7fc5639ff873311343bdc -r930dbe6d1d96a17d607c38b7b9600e9147abca44
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Commands/AddAssessmentSectionCommandTest.cs (.../AddAssessmentSectionCommandTest.cs) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Commands/AddAssessmentSectionCommandTest.cs (.../AddAssessmentSectionCommandTest.cs) (revision 930dbe6d1d96a17d607c38b7b9600e9147abca44)
@@ -71,7 +71,7 @@
// Setup
var mockRepository = new MockRepository();
var commandHandler = mockRepository.StrictMock();
- commandHandler.Expect(ch => ch.CreateAssessmentSectionFromFile());
+ commandHandler.Expect(ch => ch.AddAssessmentSectionFromFile());
mockRepository.ReplayAll();
var command = new AddAssessmentSectionCommand(commandHandler);
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Commands/AssessmentSectionFromFileCommandHandlerTest.cs
===================================================================
diff -u -r75c007324755a9f899f7fc5639ff873311343bdc -r930dbe6d1d96a17d607c38b7b9600e9147abca44
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Commands/AssessmentSectionFromFileCommandHandlerTest.cs (.../AssessmentSectionFromFileCommandHandlerTest.cs) (revision 75c007324755a9f899f7fc5639ff873311343bdc)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Commands/AssessmentSectionFromFileCommandHandlerTest.cs (.../AssessmentSectionFromFileCommandHandlerTest.cs) (revision 930dbe6d1d96a17d607c38b7b9600e9147abca44)
@@ -109,7 +109,7 @@
mockRepository.ReplayAll();
// Call
- var assessmentSectionFromFileCommandHandler =
+ var assessmentSectionFromFileCommandHandler =
new AssessmentSectionFromFileCommandHandler(parentDialogMock, projectOwnerMock, viewControllerMock);
// Assert
@@ -118,7 +118,7 @@
}
[Test]
- public void CreateAssessmentSectionFromFile_InvalidDirectory_LogsWarningProjectOwnerNotUpdated()
+ public void AddAssessmentSectionFromFile_InvalidDirectory_LogsWarningProjectOwnerNotUpdated()
{
// Setup
var mockRepository = new MockRepository();
@@ -127,13 +127,14 @@
var viewControllerMock = mockRepository.StrictMock();
mockRepository.ReplayAll();
- AssessmentSectionFromFileCommandHandler assessmentSectionFromFile = new AssessmentSectionFromFileCommandHandler(parentDialogMock, projectOwnerMock, viewControllerMock);
+ var assessmentSectionFromFileCommandHandler =
+ new AssessmentSectionFromFileCommandHandler(parentDialogMock, projectOwnerMock, viewControllerMock);
string pathToNonExistingFolder = Path.Combine(testDataPath, "I do not exist");
- SetShapeFileDirectory(assessmentSectionFromFile, pathToNonExistingFolder);
+ SetShapeFileDirectory(assessmentSectionFromFileCommandHandler, pathToNonExistingFolder);
// Call
- Action action = () => assessmentSectionFromFile.CreateAssessmentSectionFromFile();
+ Action action = () => assessmentSectionFromFileCommandHandler.AddAssessmentSectionFromFile();
// Assert
var expectedMessage = string.Format("Fout bij het lezen van bestand '{0}': De map locatie is ongeldig.", pathToNonExistingFolder);
@@ -142,7 +143,7 @@
}
[Test]
- public void CreateAssessmentSectionFromFile_validDirectoryWithEmptyShapeFile_LogsWarningProjectOwnerNotUpdated()
+ public void AddAssessmentSectionFromFile_validDirectoryWithEmptyShapeFile_LogsWarningProjectOwnerNotUpdated()
{
// Setup
var mockRepository = new MockRepository();
@@ -151,10 +152,11 @@
var viewControllerMock = mockRepository.StrictMock();
mockRepository.ReplayAll();
- AssessmentSectionFromFileCommandHandler assessmentSectionFromFile = new AssessmentSectionFromFileCommandHandler(parentDialogMock, projectOwnerMock, viewControllerMock);
+ var assessmentSectionFromFileCommandHandler =
+ new AssessmentSectionFromFileCommandHandler(parentDialogMock, projectOwnerMock, viewControllerMock);
string pathValidFolder = Path.Combine(testDataPath, "EmptyShapeFile");
- SetShapeFileDirectory(assessmentSectionFromFile, pathValidFolder);
+ SetShapeFileDirectory(assessmentSectionFromFileCommandHandler, pathValidFolder);
string messageText = null;
DialogBoxHandler = (name, wnd) =>
@@ -165,7 +167,7 @@
};
// Call
- Action action = () => assessmentSectionFromFile.CreateAssessmentSectionFromFile();
+ Action action = () => assessmentSectionFromFileCommandHandler.AddAssessmentSectionFromFile();
// Assert
const string expectedMessage = "Er kunnen geen trajecten gelezen worden uit het shape bestand.";
@@ -175,7 +177,7 @@
}
[Test]
- public void CreateAssessmentSectionFromFile_ValidDirectoryUserClicksCancel_ProjectOwnerNotUpdated()
+ public void AddAssessmentSectionFromFile_ValidDirectoryUserClicksCancel_ProjectOwnerNotUpdated()
{
// Setup
var mockRepository = new MockRepository();
@@ -184,10 +186,11 @@
var viewControllerMock = mockRepository.StrictMock();
mockRepository.ReplayAll();
- AssessmentSectionFromFileCommandHandler assessmentSectionFromFile = new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerMock, viewControllerMock);
+ var assessmentSectionFromFileCommandHandler =
+ new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerMock, viewControllerMock);
string pathValidFolder = Path.Combine(testDataPath, "ValidShapeFile");
- SetShapeFileDirectory(assessmentSectionFromFile, pathValidFolder);
+ SetShapeFileDirectory(assessmentSectionFromFileCommandHandler, pathValidFolder);
DialogBoxHandler = (name, wnd) =>
{
@@ -196,14 +199,14 @@
};
// Call
- assessmentSectionFromFile.CreateAssessmentSectionFromFile();
+ assessmentSectionFromFileCommandHandler.AddAssessmentSectionFromFile();
// Assert
mockRepository.VerifyAll();
}
[Test]
- public void CreateAssessmentSectionFromFile_ValidDirectoryOkClicked_SetsFirstReadAssessmentSection()
+ public void AddAssessmentSectionFromFile_ValidDirectoryOkClicked_SetsFirstReadAssessmentSection()
{
// Setup
var mockRepository = new MockRepository();
@@ -215,9 +218,10 @@
viewControllerMock.Expect(dvc => dvc.OpenViewForData(null)).IgnoreArguments().Return(true);
mockRepository.ReplayAll();
- AssessmentSectionFromFileCommandHandler assessmentSectionFromFile = new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerStub, viewControllerMock);
+ var assessmentSectionFromFileCommandHandler =
+ new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerStub, viewControllerMock);
string pathValidFolder = Path.Combine(testDataPath, "ValidShapeFile");
- SetShapeFileDirectory(assessmentSectionFromFile, pathValidFolder);
+ SetShapeFileDirectory(assessmentSectionFromFileCommandHandler, pathValidFolder);
int rowCount = 0;
DialogBoxHandler = (name, wnd) =>
@@ -229,18 +233,18 @@
};
// Call
- assessmentSectionFromFile.CreateAssessmentSectionFromFile();
+ assessmentSectionFromFileCommandHandler.AddAssessmentSectionFromFile();
// Assert
Assert.AreEqual(3, rowCount);
- var assessmentSection = project.AssessmentSections.FirstOrDefault();
+ AssessmentSection assessmentSection = project.AssessmentSections.FirstOrDefault();
Assert.IsNotNull(assessmentSection);
AssertAssessmentSection(TestAssessmentSection1_2(true), assessmentSection);
mockRepository.VerifyAll();
}
[Test]
- public void CreateAssessmentSectionFromFile_ValidDirectoryOkClickedForDuplicateAssessmentSection_SetsFirstReadAssessmentSectionWithUniqueName()
+ public void AddAssessmentSectionFromFile_ValidDirectoryOkClickedForDuplicateAssessmentSection_SetsFirstReadAssessmentSectionWithUniqueName()
{
// Setup
var mockRepository = new MockRepository();
@@ -252,7 +256,8 @@
viewControllerMock.Expect(dvc => dvc.OpenViewForData(null)).IgnoreArguments().Return(true);
mockRepository.ReplayAll();
- AssessmentSectionFromFileCommandHandler assessmentSectionFromFile = new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerStub, viewControllerMock);
+ var assessmentSectionFromFile =
+ new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerStub, viewControllerMock);
string pathValidFolder = Path.Combine(testDataPath, "ValidShapeFile");
SetShapeFileDirectory(assessmentSectionFromFile, pathValidFolder);
@@ -266,21 +271,21 @@
};
// Call
- assessmentSectionFromFile.CreateAssessmentSectionFromFile();
+ assessmentSectionFromFile.AddAssessmentSectionFromFile();
// Assert
Assert.AreEqual(2, project.AssessmentSections.Count);
- var assessmentSection = project.AssessmentSections[1];
+ AssessmentSection assessmentSection = project.AssessmentSections[1];
Assert.IsNotNull(assessmentSection);
- var expectedAssessmentSection = TestAssessmentSection1_2(true);
+ AssessmentSection expectedAssessmentSection = TestAssessmentSection1_2(true);
expectedAssessmentSection.Name = expectedAssessmentSectionName;
AssertAssessmentSection(expectedAssessmentSection, assessmentSection);
mockRepository.VerifyAll();
}
[Test]
- public void CreateAssessmentSectionFromFile_ValidDirectoryLowLimitSelectedOkClicked_SetsFirstReadAssessmentSectionWithLowLimit()
+ public void AddAssessmentSectionFromFile_ValidDirectoryLowLimitSelectedOkClicked_SetsFirstReadAssessmentSectionWithLowLimit()
{
// Setup
var mockRepository = new MockRepository();
@@ -305,17 +310,17 @@
};
// Call
- assessmentSectionFromFile.CreateAssessmentSectionFromFile();
+ assessmentSectionFromFile.AddAssessmentSectionFromFile();
// Assert
- var assessmentSection = project.AssessmentSections.FirstOrDefault();
+ AssessmentSection assessmentSection = project.AssessmentSections.FirstOrDefault();
Assert.IsNotNull(assessmentSection);
AssertAssessmentSection(TestAssessmentSection1_2(false), assessmentSection);
mockRepository.VerifyAll();
}
[Test]
- public void CreateAssessmentSectionFromFile_SecondRowSelectedOkClicked_SetsSecondReadAssessmentSection()
+ public void AddAssessmentSectionFromFile_SecondRowSelectedOkClicked_SetsSecondReadAssessmentSection()
{
// Setup
var mockRepository = new MockRepository();
@@ -344,18 +349,18 @@
};
// Call
- assessmentSectionFromFile.CreateAssessmentSectionFromFile();
+ assessmentSectionFromFile.AddAssessmentSectionFromFile();
// Assert
Assert.AreEqual(3, rowCount);
- var assessmentSection = project.AssessmentSections.FirstOrDefault();
+ AssessmentSection assessmentSection = project.AssessmentSections.FirstOrDefault();
Assert.IsNotNull(assessmentSection);
AssertAssessmentSection(TestAssessmentSection2_1(), assessmentSection);
mockRepository.VerifyAll();
}
[Test]
- public void CreateAssessmentSectionFromFile_ThirdRowSelectedOkClicked_SetsThirdReadAssessmentSection()
+ public void AddAssessmentSectionFromFile_ThirdRowSelectedOkClicked_SetsThirdReadAssessmentSection()
{
// Setup
var mockRepository = new MockRepository();
@@ -367,9 +372,10 @@
viewControllerMock.Expect(dvc => dvc.OpenViewForData(null)).IgnoreArguments().Return(true);
mockRepository.ReplayAll();
- AssessmentSectionFromFileCommandHandler assessmentSectionFromFile = new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerStub, viewControllerMock);
+ var assessmentSectionFromFileCommandHandler =
+ new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerStub, viewControllerMock);
string pathValidFolder = Path.Combine(testDataPath, "ValidShapeFile");
- SetShapeFileDirectory(assessmentSectionFromFile, pathValidFolder);
+ SetShapeFileDirectory(assessmentSectionFromFileCommandHandler, pathValidFolder);
DialogBoxHandler = (name, wnd) =>
{
@@ -382,19 +388,19 @@
};
// Call
- Action call = () => assessmentSectionFromFile.CreateAssessmentSectionFromFile();
+ Action call = () => assessmentSectionFromFileCommandHandler.AddAssessmentSectionFromFile();
// Assert
const string expectedMessage = @"Er zijn geen instellingen gevonden voor het geselecteerde traject. Standaardinstellingen zullen gebruikt worden.";
TestHelper.AssertLogMessageIsGenerated(call, expectedMessage);
- var assessmentSection = project.AssessmentSections.FirstOrDefault();
+ AssessmentSection assessmentSection = project.AssessmentSections.FirstOrDefault();
Assert.IsNotNull(assessmentSection);
AssertAssessmentSection(TestAssessmentSection3_3(), assessmentSection);
mockRepository.VerifyAll();
}
[Test]
- public void CreateAssessmentSectionFromFile_ShapeWithoutPointsOkClicked_LogsAndSetsAssessmentSectionWithoutReferenceLine()
+ public void AddAssessmentSectionFromFile_ShapeWithoutPointsOkClicked_LogsAndSetsAssessmentSectionWithoutReferenceLine()
{
// Setup
var mockRepository = new MockRepository();
@@ -406,9 +412,10 @@
viewControllerMock.Expect(dvc => dvc.OpenViewForData(null)).IgnoreArguments().Return(true);
mockRepository.ReplayAll();
- AssessmentSectionFromFileCommandHandler assessmentSectionFromFile = new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerStub, viewControllerMock);
+ var assessmentSectionFromFileCommandHandler =
+ new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerStub, viewControllerMock);
string pathValidFolder = Path.Combine(testDataPath, "ShapeWithoutPoints");
- SetShapeFileDirectory(assessmentSectionFromFile, pathValidFolder);
+ SetShapeFileDirectory(assessmentSectionFromFileCommandHandler, pathValidFolder);
DialogBoxHandler = (name, wnd) =>
{
@@ -421,24 +428,23 @@
};
// Call
- Action call = () => assessmentSectionFromFile.CreateAssessmentSectionFromFile();
+ Action call = () => assessmentSectionFromFileCommandHandler.AddAssessmentSectionFromFile();
// Assert
const string expectedMessage = @"Het importeren van de referentielijn is mislukt.";
TestHelper.AssertLogMessageIsGenerated(call, expectedMessage);
- var assessmentSection = project.AssessmentSections.FirstOrDefault();
+ AssessmentSection assessmentSection = project.AssessmentSections.FirstOrDefault();
Assert.IsNotNull(assessmentSection);
- var expectedAssessmentSection = TestAssessmentSection1_2(true);
- expectedAssessmentSection.ReferenceLine.SetGeometry(new Point2D[]
- {});
+ AssessmentSection expectedAssessmentSection = TestAssessmentSection1_2(true);
+ expectedAssessmentSection.ReferenceLine.SetGeometry(new Point2D[0]);
AssertAssessmentSection(expectedAssessmentSection, assessmentSection);
mockRepository.VerifyAll();
}
[Test]
- public void CreateAssessmentSectionFromFile_ShapeWithoutInvalidNormOkClicked_LogsAndSetsAssessmentSectionWithoutNorm()
+ public void AddAssessmentSectionFromFile_ShapeWithoutInvalidNormOkClicked_LogsAndSetsAssessmentSectionWithoutNorm()
{
// Setup
var mockRepository = new MockRepository();
@@ -450,9 +456,10 @@
viewControllerMock.Expect(dvc => dvc.OpenViewForData(null)).IgnoreArguments().Return(true);
mockRepository.ReplayAll();
- AssessmentSectionFromFileCommandHandler assessmentSectionFromFile = new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerStub, viewControllerMock);
+ var assessmentSectionFromFileCommandHandler =
+ new AssessmentSectionFromFileCommandHandler(parentDialogStub, projectOwnerStub, viewControllerMock);
string pathValidFolder = Path.Combine(testDataPath, "ShapeFileWithInvalidNormValue");
- SetShapeFileDirectory(assessmentSectionFromFile, pathValidFolder);
+ SetShapeFileDirectory(assessmentSectionFromFileCommandHandler, pathValidFolder);
DialogBoxHandler = (name, wnd) =>
{
@@ -465,7 +472,7 @@
};
// Call
- Action call = () => assessmentSectionFromFile.CreateAssessmentSectionFromFile();
+ Action call = () => assessmentSectionFromFileCommandHandler.AddAssessmentSectionFromFile();
// Assert
string expectedMessage = string.Format("De waarde '{0}' kan niet gezet.", "0");