Index: Riskeer/Common/src/Riskeer.Common.Forms/Controls/LengthEffectSettingsControl.cs
===================================================================
diff -u -r9c7b3107f26b93cea9eccd91b0821e3dbf66fcbf -r0dedee5ed4420b72929f83d86b139569fe8ee5cb
--- Riskeer/Common/src/Riskeer.Common.Forms/Controls/LengthEffectSettingsControl.cs (.../LengthEffectSettingsControl.cs) (revision 9c7b3107f26b93cea9eccd91b0821e3dbf66fcbf)
+++ Riskeer/Common/src/Riskeer.Common.Forms/Controls/LengthEffectSettingsControl.cs (.../LengthEffectSettingsControl.cs) (revision 0dedee5ed4420b72929f83d86b139569fe8ee5cb)
@@ -21,7 +21,6 @@
using System;
using System.Windows.Forms;
-using Core.Common.Base;
using Core.Common.Base.Data;
using Core.Common.Base.Exceptions;
using Core.Common.Base.Helpers;
@@ -38,21 +37,18 @@
{
private const int lengthEffectNNrOfDecimals = 2;
- private readonly Observer scenarioConfigurationObserver;
private double b;
private ScenarioConfigurationPerFailureMechanismSection scenarioConfigurationPerFailureMechanismSection;
private bool isParameterAUpdating;
///
- /// Creates a new instance of
+ /// Creates a new instance of .
///
public LengthEffectSettingsControl()
{
InitializeComponent();
InitializeToolTips();
-
- scenarioConfigurationObserver = new Observer(UpdateLengthEffectData);
}
///
@@ -75,7 +71,6 @@
this.b = b;
scenarioConfigurationPerFailureMechanismSection = scenarioConfiguration;
- scenarioConfigurationObserver.Observable = scenarioConfiguration;
UpdateLengthEffectData();
@@ -90,7 +85,6 @@
isParameterAUpdating = true;
scenarioConfigurationPerFailureMechanismSection = null;
- scenarioConfigurationObserver.Observable = scenarioConfigurationPerFailureMechanismSection;
ClearLengthEffectErrorMessage();
ClearLengthEffectData();
@@ -101,8 +95,6 @@
protected override void Dispose(bool disposing)
{
- scenarioConfigurationObserver.Dispose();
-
if (disposing && (components != null))
{
components.Dispose();
Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Controls/LengthEffectSettingsControlTest.cs
===================================================================
diff -u -r71306fd8f94f6182c34d9ef7e296d417ef830b10 -r0dedee5ed4420b72929f83d86b139569fe8ee5cb
--- Riskeer/Common/test/Riskeer.Common.Forms.Test/Controls/LengthEffectSettingsControlTest.cs (.../LengthEffectSettingsControlTest.cs) (revision 71306fd8f94f6182c34d9ef7e296d417ef830b10)
+++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Controls/LengthEffectSettingsControlTest.cs (.../LengthEffectSettingsControlTest.cs) (revision 0dedee5ed4420b72929f83d86b139569fe8ee5cb)
@@ -78,7 +78,7 @@
// Assert
Label parameterALabel = GetParameterALabel();
var parameterAToolTip = TypeUtils.GetField(view, "parameterAToolTip");
-
+
Assert.AreEqual("Mechanismegevoelige fractie van het dijkvak.",
parameterAToolTip.GetToolTip(parameterALabel));
Assert.AreEqual(5000, parameterAToolTip.AutoPopDelay);
@@ -393,39 +393,6 @@
}
[Test]
- public void GivenControlWithConfiguration_WhenConfigurationNotifiesObservers_ThenControlsUpdated()
- {
- // Given
- const double a = 0.4;
- const double b = 300;
-
- FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(new[]
- {
- new Point2D(0, 0),
- new Point2D(100, 0)
- });
- var scenarioConfiguration = new TestScenarioConfigurationPerFailureMechanismSection(section, (RoundedDouble) a);
-
- LengthEffectSettingsControl settingsControl = ShowLengthEffectSettingsControl();
- settingsControl.SetData(scenarioConfiguration, b);
-
- // Precondition
- TextBoxTester parameterATextBoxTester = GetParameterATextBoxTester();
- Assert.AreEqual("0,400", parameterATextBoxTester.Text);
-
- TextBox lengthEffectNRoundedTextBox = GetLengthEffectNRoundedTextBox();
- Assert.AreEqual("1,13", lengthEffectNRoundedTextBox.Text);
-
- // When
- scenarioConfiguration.A = (RoundedDouble) 0.7;
- scenarioConfiguration.NotifyObservers();
-
- // Then
- Assert.AreEqual("0,700", parameterATextBoxTester.Text);
- Assert.AreEqual("1,23", lengthEffectNRoundedTextBox.Text);
- }
-
- [Test]
public void GivenControlWithConfiguration_WhenDataClearedAndConfigurationNotifiesObservers_ThenControlsNotUpdated()
{
// Given