Index: Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/FailureMechanismContribution.cs
===================================================================
diff -u -r14de3deecd2cff7f6abe41ed6dc5dc016c4c81e0 -r0b6cce0bd86288273634f7ead3817885a7c20fd0
--- Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/FailureMechanismContribution.cs (.../FailureMechanismContribution.cs) (revision 14de3deecd2cff7f6abe41ed6dc5dc016c4c81e0)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/Contribution/FailureMechanismContribution.cs (.../FailureMechanismContribution.cs) (revision 0b6cce0bd86288273634f7ead3817885a7c20fd0)
@@ -61,6 +61,7 @@
///
/// Gets or sets the norm which has been defined on the assessment section.
///
+ /// Thrown when the new value is lower than or equal to 0.
public int Norm
{
get
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs
===================================================================
diff -u -r17ec0ca5a375889a40d67a6130b1c7f1d0a375fe -r0b6cce0bd86288273634f7ead3817885a7c20fd0
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 17ec0ca5a375889a40d67a6130b1c7f1d0a375fe)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 0b6cce0bd86288273634f7ead3817885a7c20fd0)
@@ -267,9 +267,8 @@
ringtoetsProject.Items.Add(assessmentSection);
ringtoetsProject.NotifyObservers();
- if (Gui != null && (Gui.Selection == null || !Gui.Selection.Equals(assessmentSection)))
+ if (Gui != null)
{
- Gui.Selection = assessmentSection;
Gui.DocumentViewController.OpenViewForData(assessmentSection);
}
}
Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs
===================================================================
diff -u -r17ec0ca5a375889a40d67a6130b1c7f1d0a375fe -r0b6cce0bd86288273634f7ead3817885a7c20fd0
--- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 17ec0ca5a375889a40d67a6130b1c7f1d0a375fe)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 0b6cce0bd86288273634f7ead3817885a7c20fd0)
@@ -522,112 +522,6 @@
}
[Test]
- public void SetAssessmentSectionToProject_NoSelectionSet_SelectionSetUpdated()
- {
- // Setup
- var mockRepository = new MockRepository();
- var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike);
-
- var documentViewControllerMock = mockRepository.StrictMock();
- documentViewControllerMock.Expect(d => d.OpenViewForData(assessmentSection)).Return(true);
-
- var guiMock = mockRepository.StrictMock();
- guiMock.Stub(g => g.SelectionChanged += null).IgnoreArguments();
- guiMock.Stub(g => g.SelectionChanged -= null).IgnoreArguments();
- guiMock.Expect(g => g.ProjectOpened += null).IgnoreArguments();
- guiMock.Stub(g => g.ProjectOpened -= null).IgnoreArguments();
- guiMock.Expect(g => g.Selection).SetPropertyWithArgument(assessmentSection);
- guiMock.Expect(g => g.Selection).Return(null);
- guiMock.Expect(g => g.DocumentViewController).Return(documentViewControllerMock);
- mockRepository.ReplayAll();
-
- var project = new RingtoetsProject();
-
- using (var plugin = new RingtoetsPlugin())
- {
- plugin.Gui = guiMock;
-
- // Call
- plugin.SetAssessmentSectionToProject(project, assessmentSection);
- }
-
- // Assert
- Assert.AreEqual(1, project.Items.Count);
- CollectionAssert.Contains(project.Items, assessmentSection);
- mockRepository.VerifyAll();
- }
-
- [Test]
- public void SetAssessmentSectionToProject_SelectionAlreadySetToSameAssessmentSection_SelectionNotUpdated()
- {
- // Setup
- var mockRepository = new MockRepository();
- var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike);
-
- var guiMock = mockRepository.StrictMock();
- guiMock.Stub(g => g.SelectionChanged += null).IgnoreArguments();
- guiMock.Stub(g => g.SelectionChanged -= null).IgnoreArguments();
- guiMock.Expect(g => g.ProjectOpened += null).IgnoreArguments();
- guiMock.Stub(g => g.ProjectOpened -= null).IgnoreArguments();
-
- guiMock.Expect(g => g.Selection).Return(assessmentSection).Repeat.AtLeastOnce();
-
- mockRepository.ReplayAll();
-
- var project = new RingtoetsProject();
-
- using (var plugin = new RingtoetsPlugin())
- {
- plugin.Gui = guiMock;
-
- // Call
- plugin.SetAssessmentSectionToProject(project, assessmentSection);
- }
-
- // Assert
- Assert.AreEqual(1, project.Items.Count);
- CollectionAssert.Contains(project.Items, assessmentSection);
- mockRepository.VerifyAll();
- }
-
- [Test]
- public void SetAssessmentSectionToProject_SelectionAlreadySetToDifferentAssessmentSection_SelectionUpdated()
- {
- // Setup
- var mockRepository = new MockRepository();
- var previousAssessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike);
- var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike);
-
- var documentViewControllerMock = mockRepository.StrictMock();
- documentViewControllerMock.Expect(d => d.OpenViewForData(assessmentSection)).Return(true);
-
- var guiMock = mockRepository.StrictMock();
- guiMock.Stub(g => g.SelectionChanged += null).IgnoreArguments();
- guiMock.Stub(g => g.SelectionChanged -= null).IgnoreArguments();
- guiMock.Expect(g => g.ProjectOpened += null).IgnoreArguments();
- guiMock.Stub(g => g.ProjectOpened -= null).IgnoreArguments();
- guiMock.Expect(g => g.Selection).SetPropertyWithArgument(assessmentSection);
- guiMock.Expect(g => g.Selection).Return(previousAssessmentSection).Repeat.AtLeastOnce();
- guiMock.Expect(g => g.DocumentViewController).Return(documentViewControllerMock);
- mockRepository.ReplayAll();
-
- var project = new RingtoetsProject();
-
- using (var plugin = new RingtoetsPlugin())
- {
- plugin.Gui = guiMock;
-
- // Call
- plugin.SetAssessmentSectionToProject(project, assessmentSection);
- }
-
- // Assert
- Assert.AreEqual(1, project.Items.Count);
- CollectionAssert.Contains(project.Items, assessmentSection);
- mockRepository.VerifyAll();
- }
-
- [Test]
public void WhenAddingAssessmentSection_GivenProjectHasAssessmentSection_ThenAddedAssessmentSectionHasUniqueName()
{
// Setup