Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs =================================================================== diff -u -r922504df809b08d203bdd5d504445e8b64cfd412 -r3209fba2fd7c48ba59e92a99c83799e3deeb24ad --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs (.../HeightStructuresScenariosView.cs) (revision 922504df809b08d203bdd5d504445e8b64cfd412) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs (.../HeightStructuresScenariosView.cs) (revision 3209fba2fd7c48ba59e92a99c83799e3deeb24ad) @@ -23,7 +23,6 @@ using System.Collections.Generic; using System.Linq; using Core.Common.Base.Geometry; -using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.Calculation; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Structures; @@ -37,28 +36,17 @@ /// public class HeightStructuresScenariosView : ScenariosView, HeightStructuresInput, HeightStructuresScenarioRow, HeightStructuresFailureMechanism> { - private readonly IAssessmentSection assessmentSection; - /// /// Creates a new instance of . /// /// The data to show in this view. /// The /// the belongs to. - /// The assessment section the scenarios belong to. /// Thrown when any parameter /// is null. - public HeightStructuresScenariosView(CalculationGroup calculationGroup, HeightStructuresFailureMechanism failureMechanism, IAssessmentSection assessmentSection) - : base(calculationGroup, failureMechanism) - { - if (assessmentSection == null) - { - throw new ArgumentNullException(nameof(assessmentSection)); - } + public HeightStructuresScenariosView(CalculationGroup calculationGroup, HeightStructuresFailureMechanism failureMechanism) + : base(calculationGroup, failureMechanism) {} - this.assessmentSection = assessmentSection; - } - protected override HeightStructuresInput GetCalculationInput(StructuresCalculationScenario calculationScenario) { return calculationScenario.InputParameters; Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs =================================================================== diff -u -r65fa32b1acf95b7ac64bf78c7df5e1852ac809bf -r3209fba2fd7c48ba59e92a99c83799e3deeb24ad --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 65fa32b1acf95b7ac64bf78c7df5e1852ac809bf) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 3209fba2fd7c48ba59e92a99c83799e3deeb24ad) @@ -182,7 +182,7 @@ { GetViewData = context => context.WrappedData, GetViewName = (view, context) => RiskeerCommonFormsResources.Scenarios_DisplayName, - CreateInstance = context => new HeightStructuresScenariosView(context.WrappedData, context.ParentFailureMechanism, context.AssessmentSection), + CreateInstance = context => new HeightStructuresScenariosView(context.WrappedData, context.ParentFailureMechanism), CloseForData = CloseScenariosViewForData, Image = RiskeerCommonFormsResources.ScenariosIcon }; Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/Views/HeightStructuresScenariosViewTest.cs =================================================================== diff -u -r35349144a21f4e3627505605840f286b21b2d004 -r3209fba2fd7c48ba59e92a99c83799e3deeb24ad --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/Views/HeightStructuresScenariosViewTest.cs (.../HeightStructuresScenariosViewTest.cs) (revision 35349144a21f4e3627505605840f286b21b2d004) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/Views/HeightStructuresScenariosViewTest.cs (.../HeightStructuresScenariosViewTest.cs) (revision 3209fba2fd7c48ba59e92a99c83799e3deeb24ad) @@ -25,8 +25,6 @@ using Core.Common.Base.Geometry; using NUnit.Extensions.Forms; using NUnit.Framework; -using Rhino.Mocks; -using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.Calculation; using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Structures; @@ -62,35 +60,18 @@ } [Test] - public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() - { - // Call - void Call() => new HeightStructuresScenariosView(new CalculationGroup(), new HeightStructuresFailureMechanism(), null); - - // Assert - var exception = Assert.Throws(Call); - Assert.AreEqual("assessmentSection", exception.ParamName); - } - - [Test] public void Constructor_ExpectedValues() { // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - var calculationGroup = new CalculationGroup(); // Call - using (var view = new HeightStructuresScenariosView(calculationGroup, new HeightStructuresFailureMechanism(), assessmentSection)) + using (var view = new HeightStructuresScenariosView(calculationGroup, new HeightStructuresFailureMechanism())) { // Assert Assert.IsInstanceOf, HeightStructuresInput, HeightStructuresScenarioRow, HeightStructuresFailureMechanism>>(view); Assert.AreSame(calculationGroup, view.Data); } - - mocks.VerifyAll(); } [Test] @@ -182,7 +163,7 @@ private void ShowHeightStructuresScenariosView(HeightStructuresFailureMechanism failureMechanism) { - var scenariosView = new HeightStructuresScenariosView(failureMechanism.CalculationsGroup, failureMechanism, new AssessmentSectionStub()); + var scenariosView = new HeightStructuresScenariosView(failureMechanism.CalculationsGroup, failureMechanism); testForm.Controls.Add(scenariosView); testForm.Show(); } Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Integration.Test/HeightStructuresScenariosViewIntegrationTest.cs =================================================================== diff -u -r35349144a21f4e3627505605840f286b21b2d004 -r3209fba2fd7c48ba59e92a99c83799e3deeb24ad --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Integration.Test/HeightStructuresScenariosViewIntegrationTest.cs (.../HeightStructuresScenariosViewIntegrationTest.cs) (revision 35349144a21f4e3627505605840f286b21b2d004) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Integration.Test/HeightStructuresScenariosViewIntegrationTest.cs (.../HeightStructuresScenariosViewIntegrationTest.cs) (revision 3209fba2fd7c48ba59e92a99c83799e3deeb24ad) @@ -63,7 +63,7 @@ var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); DataImportHelper.ImportReferenceLine(assessmentSection); - var view = new HeightStructuresScenariosView(assessmentSection.HeightStructures.CalculationsGroup, assessmentSection.HeightStructures, assessmentSection); + var view = new HeightStructuresScenariosView(assessmentSection.HeightStructures.CalculationsGroup, assessmentSection.HeightStructures); form.Controls.Add(view); form.Show(); @@ -98,7 +98,7 @@ DataImportHelper.ImportFailureMechanismSections(assessmentSection, failureMechanism); CalculationGroup calculationsGroup = assessmentSection.HeightStructures.CalculationsGroup; - var view = new HeightStructuresScenariosView(calculationsGroup, assessmentSection.HeightStructures, assessmentSection); + var view = new HeightStructuresScenariosView(calculationsGroup, assessmentSection.HeightStructures); form.Controls.Add(view); form.Show(); @@ -162,7 +162,7 @@ DataImportHelper.ImportFailureMechanismSections(assessmentSection, failureMechanism); CalculationGroup calculationsGroup = assessmentSection.HeightStructures.CalculationsGroup; - var view = new HeightStructuresScenariosView(calculationsGroup, assessmentSection.HeightStructures, assessmentSection); + var view = new HeightStructuresScenariosView(calculationsGroup, assessmentSection.HeightStructures); form.Controls.Add(view); form.Show(); @@ -226,7 +226,7 @@ HeightStructuresFailureMechanism failureMechanism = assessmentSection.HeightStructures; DataImportHelper.ImportFailureMechanismSections(assessmentSection, failureMechanism); - var view = new HeightStructuresScenariosView(assessmentSection.HeightStructures.CalculationsGroup, assessmentSection.HeightStructures, assessmentSection); + var view = new HeightStructuresScenariosView(assessmentSection.HeightStructures.CalculationsGroup, assessmentSection.HeightStructures); form.Controls.Add(view); form.Show(); Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs =================================================================== diff -u -rfdef7e5b0412c76725a15c5d73a16d3915636da2 -r3209fba2fd7c48ba59e92a99c83799e3deeb24ad --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs (.../HeightStructuresScenariosViewInfoTest.cs) (revision fdef7e5b0412c76725a15c5d73a16d3915636da2) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs (.../HeightStructuresScenariosViewInfoTest.cs) (revision 3209fba2fd7c48ba59e92a99c83799e3deeb24ad) @@ -117,7 +117,7 @@ }); mocks.ReplayAll(); - using (var view = new HeightStructuresScenariosView(new CalculationGroup(), new HeightStructuresFailureMechanism(), assessmentSection)) + using (var view = new HeightStructuresScenariosView(new CalculationGroup(), new HeightStructuresFailureMechanism())) { // Precondition Assert.AreNotSame(view.Data, unrelatedFailureMechanism.CalculationsGroup); @@ -146,7 +146,7 @@ }); mocks.ReplayAll(); - using (var view = new HeightStructuresScenariosView(relatedFailureMechanism.CalculationsGroup, relatedFailureMechanism, assessmentSection)) + using (var view = new HeightStructuresScenariosView(relatedFailureMechanism.CalculationsGroup, relatedFailureMechanism)) { // Precondition Assert.AreSame(view.Data, relatedFailureMechanism.CalculationsGroup); @@ -170,7 +170,7 @@ assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); mocks.ReplayAll(); - using (var view = new HeightStructuresScenariosView(new CalculationGroup(), new HeightStructuresFailureMechanism(), assessmentSection)) + using (var view = new HeightStructuresScenariosView(new CalculationGroup(), new HeightStructuresFailureMechanism())) { // Call bool closeForData = info.CloseForData(view, assessmentSection); @@ -193,7 +193,7 @@ var failureMechanism = new HeightStructuresFailureMechanism(); var context = new HeightStructuresFailurePathContext(new HeightStructuresFailureMechanism(), assessmentSection); - using (var view = new HeightStructuresScenariosView(failureMechanism.CalculationsGroup, failureMechanism, assessmentSection)) + using (var view = new HeightStructuresScenariosView(failureMechanism.CalculationsGroup, failureMechanism)) { // Call bool closeForData = info.CloseForData(view, context); @@ -216,7 +216,7 @@ var failureMechanism = new HeightStructuresFailureMechanism(); var context = new HeightStructuresFailurePathContext(failureMechanism, assessmentSection); - using (var view = new HeightStructuresScenariosView(failureMechanism.CalculationsGroup, failureMechanism, assessmentSection)) + using (var view = new HeightStructuresScenariosView(failureMechanism.CalculationsGroup, failureMechanism)) { // Call bool closeForData = info.CloseForData(view, context);