Index: Riskeer/Common/src/Riskeer.Common.Forms/PropertyClasses/FailureMechanismSectionsProbabilityAssessmentProperties.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/src/Riskeer.Common.Forms/PropertyClasses/FailureMechanismSectionsProbabilityAssessmentProperties.cs (.../FailureMechanismSectionsProbabilityAssessmentProperties.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Common/src/Riskeer.Common.Forms/PropertyClasses/FailureMechanismSectionsProbabilityAssessmentProperties.cs (.../FailureMechanismSectionsProbabilityAssessmentProperties.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -112,9 +112,8 @@ } } - private FailureMechanismSectionProbabilityAssessmentProperties CreateFailureMechanismSectionProbabilityAssessmentProperties(FailureMechanismSection section, - double sectionStart, - double sectionEnd) + private FailureMechanismSectionProbabilityAssessmentProperties CreateFailureMechanismSectionProbabilityAssessmentProperties( + FailureMechanismSection section, double sectionStart, double sectionEnd) { return new FailureMechanismSectionProbabilityAssessmentProperties(section, sectionStart, sectionEnd, probabilityAssessmentInput); } Index: Riskeer/Common/src/Riskeer.Common.Forms/Views/CalculationsView.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/src/Riskeer.Common.Forms/Views/CalculationsView.cs (.../CalculationsView.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Common/src/Riskeer.Common.Forms/Views/CalculationsView.cs (.../CalculationsView.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -43,12 +43,12 @@ /// The type of calculation. /// The type of the calculation input. /// The type of the calculation row. - /// The type of the failure mechanism. + /// The type of the calculatable failure mechanism. public abstract partial class CalculationsView : UserControl, ISelectionProvider, IView where TCalculation : class, ICalculation where TCalculationRow : CalculationRow where TCalculationInput : class, ICalculationInput - where TFailureMechanism : IFailureMechanism + where TFailureMechanism : ICalculatableFailureMechanism { private int nameColumnIndex = -1; private int selectableHydraulicBoundaryLocationColumnIndex = -1; Index: Riskeer/Common/src/Riskeer.Common.Forms/Views/ScenariosView.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/src/Riskeer.Common.Forms/Views/ScenariosView.cs (.../ScenariosView.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Common/src/Riskeer.Common.Forms/Views/ScenariosView.cs (.../ScenariosView.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -38,12 +38,12 @@ /// The type of calculation scenario. /// The type of calculation input. /// The type of the scenario row. - /// The type of the failure mechanism. + /// The type of the calculatable failure mechanism. public abstract partial class ScenariosView : UserControl, IView where TCalculationScenario : class, ICalculationScenario where TCalculationInput : class, ICalculationInput where TScenarioRow : ScenarioRow - where TFailureMechanism : IFailureMechanism + where TFailureMechanism : ICalculatableFailureMechanism { private Observer failureMechanismObserver; private RecursiveObserver calculationGroupObserver; Index: Riskeer/Common/src/Riskeer.Common.IO/FileImporters/FailureMechanismSectionReplaceStrategy.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/src/Riskeer.Common.IO/FileImporters/FailureMechanismSectionReplaceStrategy.cs (.../FailureMechanismSectionReplaceStrategy.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Common/src/Riskeer.Common.IO/FileImporters/FailureMechanismSectionReplaceStrategy.cs (.../FailureMechanismSectionReplaceStrategy.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -33,22 +33,22 @@ /// public class FailureMechanismSectionReplaceStrategy : IFailureMechanismSectionUpdateStrategy { - private readonly IFailureMechanism failurePath; + private readonly IFailureMechanism failureMechanism; /// /// Creates a new instance of . /// - /// The failure path to set the sections to. - /// Thrown when + /// The failure mechanism to set the sections to. + /// Thrown when /// is null. - public FailureMechanismSectionReplaceStrategy(IFailureMechanism failurePath) + public FailureMechanismSectionReplaceStrategy(IFailureMechanism failureMechanism) { - if (failurePath == null) + if (failureMechanism == null) { - throw new ArgumentNullException(nameof(failurePath)); + throw new ArgumentNullException(nameof(failureMechanism)); } - this.failurePath = failurePath; + this.failureMechanism = failureMechanism; } public virtual IEnumerable UpdateSectionsWithImportedData(IEnumerable importedFailureMechanismSections, @@ -68,9 +68,9 @@ try { - failurePath.SetSections(importedFailureMechanismSections, sourcePath); - affectedObjects.Add(failurePath); - affectedObjects.Add(failurePath.SectionResults); + failureMechanism.SetSections(importedFailureMechanismSections, sourcePath); + affectedObjects.Add(failureMechanism); + affectedObjects.Add(failureMechanism.SectionResults); } catch (ArgumentException e) { Index: Riskeer/Common/test/Riskeer.Common.Data.Test/Structures/StructuresFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r24ca14cba20d34921dea3b900f7f2e895f85bfaa -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Data.Test/Structures/StructuresFailureMechanismAssemblyFactoryTest.cs (.../StructuresFailureMechanismAssemblyFactoryTest.cs) (revision 24ca14cba20d34921dea3b900f7f2e895f85bfaa) +++ Riskeer/Common/test/Riskeer.Common.Data.Test/Structures/StructuresFailureMechanismAssemblyFactoryTest.cs (.../StructuresFailureMechanismAssemblyFactoryTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -49,7 +49,7 @@ var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); // Call void Call() => StructuresFailureMechanismAssemblyFactory.AssembleSection(null, failureMechanism, assessmentSection); @@ -89,7 +89,7 @@ FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var sectionResult = new AdoptableFailureMechanismSectionResult(section); - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); // Call void Call() => StructuresFailureMechanismAssemblyFactory.AssembleSection(sectionResult, failureMechanism, null); @@ -114,7 +114,7 @@ RefinedSectionProbability = random.NextDouble() }; - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); var assessmentSection = new AssessmentSectionStub(); using (new AssemblyToolCalculatorFactoryConfig()) @@ -144,7 +144,7 @@ public void AssembleSection_CalculatorRan_ReturnsExpectedOutput() { // Setup - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var sectionResult = new AdoptableFailureMechanismSectionResult(section); @@ -168,7 +168,7 @@ public void AssembleSection_CalculatorThrowsException_ThrowsAssemblyException() { // Setup - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var sectionResult = new AdoptableFailureMechanismSectionResult(section); Index: Riskeer/Common/test/Riskeer.Common.Data.Test/UpdateDataStrategies/ReplaceDataStrategyBaseTest.cs =================================================================== diff -u -r96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Data.Test/UpdateDataStrategies/ReplaceDataStrategyBaseTest.cs (.../ReplaceDataStrategyBaseTest.cs) (revision 96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a) +++ Riskeer/Common/test/Riskeer.Common.Data.Test/UpdateDataStrategies/ReplaceDataStrategyBaseTest.cs (.../ReplaceDataStrategyBaseTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -37,21 +37,21 @@ public void Constructor_FailureMechanismNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new ConcreteStrategyClass(null, new TestUniqueItemCollection()); + void Call() => new ConcreteStrategyClass(null, new TestUniqueItemCollection()); // Assert - string paramName = Assert.Throws(call).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("failureMechanism", paramName); } [Test] public void Constructor_TargetCollectionNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new ConcreteStrategyClass(new TestFailureMechanism(), null); + void Call() => new ConcreteStrategyClass(new TestFailureMechanism(), null); // Assert - string paramName = Assert.Throws(call).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("targetCollection", paramName); } @@ -63,10 +63,10 @@ var strategy = new ConcreteStrategyClass(new TestFailureMechanism(), collection); // Call - TestDelegate call = () => strategy.ConcreteReplaceData(null, string.Empty); + void Call() => strategy.ConcreteReplaceData(null, string.Empty); // Assert - string paramName = Assert.Throws(call).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("importedDataCollection", paramName); } @@ -78,10 +78,10 @@ var strategy = new ConcreteStrategyClass(new TestFailureMechanism(), collection); // Call - TestDelegate call = () => strategy.ConcreteReplaceData(Enumerable.Empty(), null); + void Call() => strategy.ConcreteReplaceData(Enumerable.Empty(), null); // Assert - string paramName = Assert.Throws(call).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("sourceFilePath", paramName); } @@ -139,12 +139,12 @@ }; // Call - TestDelegate call = () => strategy.ConcreteReplaceData(itemsToAdd, "some/source"); + void Call() => strategy.ConcreteReplaceData(itemsToAdd, "some/source"); // Assert CollectionAssert.IsEmpty(collection); - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.IsInstanceOf(exception.InnerException); } @@ -165,12 +165,12 @@ }; // Call - TestDelegate call = () => strategy.ConcreteReplaceData(itemsToAdd, invalidPath); + void Call() => strategy.ConcreteReplaceData(itemsToAdd, invalidPath); // Assert CollectionAssert.IsEmpty(collection); - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.IsInstanceOf(exception.InnerException); } Index: Riskeer/Common/test/Riskeer.Common.Data.Test/UpdateDataStrategies/UpdateDataStrategyBaseTest.cs =================================================================== diff -u -r96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Data.Test/UpdateDataStrategies/UpdateDataStrategyBaseTest.cs (.../UpdateDataStrategyBaseTest.cs) (revision 96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a) +++ Riskeer/Common/test/Riskeer.Common.Data.Test/UpdateDataStrategies/UpdateDataStrategyBaseTest.cs (.../UpdateDataStrategyBaseTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -39,43 +39,43 @@ public void Constructor_FailureMechanismNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new TestUpdateDataStrategy(null, new NameComparer(), new TestUniqueItemCollection()); + void Call() => new TestUpdateDataStrategy(null, new NameComparer(), new TestUniqueItemCollection()); // Assert - string paramName = Assert.Throws(call).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("failureMechanism", paramName); } [Test] public void Constructor_EqualityComparerNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new TestUpdateDataStrategy(new TestFailureMechanism(), null, new TestUniqueItemCollection()); + void Call() => new TestUpdateDataStrategy(new TestFailureMechanism(), null, new TestUniqueItemCollection()); // Assert - string paramName = Assert.Throws(call).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("equalityComparer", paramName); } [Test] public void Constructor_TargetCollectionNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => new TestUpdateDataStrategy(new TestFailureMechanism(), new NameComparer(), null); + void Call() => new TestUpdateDataStrategy(new TestFailureMechanism(), new NameComparer(), null); // Assert - string paramName = Assert.Throws(call).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("targetCollection", paramName); } [Test] public void Constructor_ParametersSet_DoesNotThrowException() { // Call - TestDelegate call = () => new TestUpdateDataStrategy(new TestFailureMechanism(), new NameComparer(), new TestUniqueItemCollection()); + void Call() => new TestUpdateDataStrategy(new TestFailureMechanism(), new NameComparer(), new TestUniqueItemCollection()); // Assert - Assert.DoesNotThrow(call); + Assert.DoesNotThrow(Call); } [Test] @@ -85,10 +85,10 @@ TestUpdateDataStrategy strategy = CreateDefaultTestStrategy(new TestUniqueItemCollection()); // Call - TestDelegate call = () => strategy.ConcreteUpdateData(null, string.Empty); + void Call() => strategy.ConcreteUpdateData(null, string.Empty); // Assert - string paramName = Assert.Throws(call).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("importedDataCollection", paramName); } @@ -99,13 +99,14 @@ TestUpdateDataStrategy strategy = CreateDefaultTestStrategy(new TestUniqueItemCollection()); // Call - TestDelegate call = () => strategy.ConcreteUpdateData(new TestItem[] - { - null - }, string.Empty); + void Call() => + strategy.ConcreteUpdateData(new TestItem[] + { + null + }, string.Empty); // Assert - string paramName = Assert.Throws(call).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("updatedObjects", paramName); } @@ -117,10 +118,10 @@ TestUpdateDataStrategy strategy = CreateDefaultTestStrategy(collection); // Call - TestDelegate call = () => strategy.ConcreteUpdateData(Enumerable.Empty(), null); + void Call() => strategy.ConcreteUpdateData(Enumerable.Empty(), null); // Assert - string paramName = Assert.Throws(call).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("sourceFilePath", paramName); } @@ -237,10 +238,10 @@ TestUpdateDataStrategy strategy = CreateDefaultTestStrategy(collection); // Call - TestDelegate call = () => strategy.ConcreteUpdateData(importedCollection, sourceFilePath); + void Call() => strategy.ConcreteUpdateData(importedCollection, sourceFilePath); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); const string message = "Geïmporteerde data moet unieke elementen bevatten."; Assert.AreEqual(message, exception.Message); @@ -522,11 +523,10 @@ TestUpdateDataStrategy strategy = CreateDefaultTestStrategy(collection); // Call - TestDelegate call = () => strategy.ConcreteUpdateData(importedItems, - sourceFilePath); + void Call() => strategy.ConcreteUpdateData(importedItems, sourceFilePath); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("Geïmporteerde data moet unieke elementen bevatten.", exception.Message); } Index: Riskeer/Common/test/Riskeer.Common.Data.TestUtil/TestCalculatableFailureMechanism.cs =================================================================== diff -u --- Riskeer/Common/test/Riskeer.Common.Data.TestUtil/TestCalculatableFailureMechanism.cs (revision 0) +++ Riskeer/Common/test/Riskeer.Common.Data.TestUtil/TestCalculatableFailureMechanism.cs (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -0,0 +1,88 @@ +// Copyright (C) Stichting Deltares 2021. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using Core.Common.Base; +using Riskeer.Common.Data.Calculation; +using Riskeer.Common.Data.FailureMechanism; + +namespace Riskeer.Common.Data.TestUtil +{ + /// + /// Simple calculatable failure mechanism which can be used for testing. + /// + public class TestCalculatableFailureMechanism : FailureMechanismBase, + IHasGeneralInput, ICalculatableFailureMechanism + { + private const string defaultName = "Test failure mechanism"; + private const string defaultCode = "TFM"; + + /// + /// Creates a new instance of with a default name and code. + /// + public TestCalculatableFailureMechanism() + : this(defaultName, defaultCode) {} + + /// + /// Creates a new instance of based on the input arguments. + /// + /// The name of the failure mechanism. + /// The code of the failure mechanism. + /// Thrown when either: + /// + /// is null or empty. + /// is null or empty. + /// + /// + public TestCalculatableFailureMechanism(string name, string code) + : this(name, code, new List()) {} + + /// + /// Creates a new instance of based on the input arguments. + /// + /// The collection of . + public TestCalculatableFailureMechanism(IEnumerable calculations) + : this(defaultName, defaultCode, calculations) {} + + private TestCalculatableFailureMechanism(string name, string code, IEnumerable calculations) + : base(name, code) + { + CalculationsGroup = new CalculationGroup(); + CalculationsGroup.Children.AddRange(calculations); + GeneralInput = new GeneralInput(); + CalculationsInputComments = new Comment(); + } + + public CalculationGroup CalculationsGroup { get; } + + public Comment CalculationsInputComments { get; } + + public IEnumerable Calculations => CalculationsGroup.GetCalculations(); + + public GeneralInput GeneralInput { get; } + + protected override void AddSectionDependentData(FailureMechanismSection section) + { + ((ObservableList) SectionResults).Add(new TestFailureMechanismSectionResult(section)); + } + } +} \ No newline at end of file Index: Riskeer/Common/test/Riskeer.Common.Data.TestUtil/TestFailureMechanism.cs =================================================================== diff -u -rddad604681c45ff2276b5b75590b8699d6c211d4 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Data.TestUtil/TestFailureMechanism.cs (.../TestFailureMechanism.cs) (revision ddad604681c45ff2276b5b75590b8699d6c211d4) +++ Riskeer/Common/test/Riskeer.Common.Data.TestUtil/TestFailureMechanism.cs (.../TestFailureMechanism.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -22,67 +22,80 @@ using System; using System.Collections.Generic; using Core.Common.Base; -using Riskeer.Common.Data.Calculation; using Riskeer.Common.Data.FailureMechanism; namespace Riskeer.Common.Data.TestUtil { /// /// Simple failure mechanism which can be used for testing. /// - public class TestFailureMechanism : FailureMechanismBase, - IHasGeneralInput, ICalculatableFailureMechanism + public class TestFailureMechanism : Observable, IFailureMechanism, IHasGeneralInput { - private const string defaultName = "Test failure mechanism"; - private const string defaultCode = "TFM"; + private readonly FailureMechanismSectionCollection sectionCollection; + private readonly ObservableList sectionResults; /// - /// Creates a new instance of with a default name and code. + /// Creates a new instance of . /// public TestFailureMechanism() - : this(defaultName, defaultCode) {} - - /// - /// Creates a new instance of based on the input arguments. - /// - /// The name of the failure mechanism. - /// The code of the failure mechanism. - /// Thrown when either: - /// - /// is null or empty. - /// is null or empty. - /// - /// - public TestFailureMechanism(string name, string code) - : this(name, code, new List()) {} - - /// - /// Creates a new instance of based on the input arguments. - /// - /// The collection of . - public TestFailureMechanism(IEnumerable calculations) - : this(defaultName, defaultCode, calculations) {} - - private TestFailureMechanism(string name, string code, IEnumerable calculations) - : base(name, code) { - CalculationsGroup = new CalculationGroup(); - CalculationsGroup.Children.AddRange(calculations); + Name = "Faalmechanisme"; + Code = "NIEUW"; + + sectionCollection = new FailureMechanismSectionCollection(); + InAssembly = true; GeneralInput = new GeneralInput(); - CalculationsInputComments = new Comment(); + InAssemblyInputComments = new Comment(); + InAssemblyOutputComments = new Comment(); + NotInAssemblyComments = new Comment(); + AssemblyResult = new FailureMechanismAssemblyResult(); + sectionResults = new ObservableList(); } - public CalculationGroup CalculationsGroup { get; } + public string Name { get; } - public Comment CalculationsInputComments { get; } + public string Code { get; } - public IEnumerable Calculations => CalculationsGroup.GetCalculations(); + public IEnumerable Sections => sectionCollection; + public FailureMechanismAssemblyResult AssemblyResult { get; } + + public string FailureMechanismSectionSourcePath => sectionCollection.SourcePath; + + public Comment InAssemblyInputComments { get; } + + public Comment InAssemblyOutputComments { get; } + + public Comment NotInAssemblyComments { get; } + + public bool InAssembly { get; set; } + + public IObservableEnumerable SectionResults => sectionResults; + public GeneralInput GeneralInput { get; } - protected override void AddSectionDependentData(FailureMechanismSection section) + public void SetSections(IEnumerable sections, string sourcePath) { - ((ObservableList) SectionResults).Add(new TestFailureMechanismSectionResult(section)); + if (sections == null) + { + throw new ArgumentNullException(nameof(sections)); + } + + if (sourcePath == null) + { + throw new ArgumentNullException(nameof(sourcePath)); + } + + sectionCollection.SetSections(sections, sourcePath); + foreach (FailureMechanismSection section in sections) + { + sectionResults.Add(new TestFailureMechanismSectionResult(section)); + } } + + public void ClearAllSections() + { + sectionCollection.Clear(); + } } } \ No newline at end of file Fisheye: Tag e52a2b934228724b12e794fc38b91c69400bfabc refers to a dead (removed) revision in file `Riskeer/Common/test/Riskeer.Common.Data.TestUtil/TestFailurePath.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/ChangeHandlers/FailureMechanismCalculationChangeHandlerTest.cs =================================================================== diff -u -r69a3e850d387ba5c1253a24c2fdf5744bd6959f0 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/ChangeHandlers/FailureMechanismCalculationChangeHandlerTest.cs (.../FailureMechanismCalculationChangeHandlerTest.cs) (revision 69a3e850d387ba5c1253a24c2fdf5744bd6959f0) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/ChangeHandlers/FailureMechanismCalculationChangeHandlerTest.cs (.../FailureMechanismCalculationChangeHandlerTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -112,7 +112,7 @@ var inquiryHandler = mockRepository.StrictMock(); mockRepository.ReplayAll(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var handler = new FailureMechanismCalculationChangeHandler(failureMechanism, string.Empty, inquiryHandler); @@ -135,7 +135,7 @@ calculation.Expect(calc => calc.HasOutput).Return(false); mockRepository.ReplayAll(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -161,7 +161,7 @@ calculation.Expect(calc => calc.HasOutput).Return(true); mockRepository.ReplayAll(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/ChangeHandlers/FailureMechanismPropertyChangeHandlerTest.cs =================================================================== diff -u -r69a3e850d387ba5c1253a24c2fdf5744bd6959f0 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/ChangeHandlers/FailureMechanismPropertyChangeHandlerTest.cs (.../FailureMechanismPropertyChangeHandlerTest.cs) (revision 69a3e850d387ba5c1253a24c2fdf5744bd6959f0) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/ChangeHandlers/FailureMechanismPropertyChangeHandlerTest.cs (.../FailureMechanismPropertyChangeHandlerTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -68,7 +68,7 @@ var changeHandler = new FailureMechanismPropertyChangeHandler(); // Call - void Call() => changeHandler.SetPropertyValueAfterConfirmation(new TestFailureMechanism(), null, (f, v) => {}); + void Call() => changeHandler.SetPropertyValueAfterConfirmation(new TestCalculatableFailureMechanism(), null, (f, v) => {}); // Assert string paramName = Assert.Throws(Call).ParamName; @@ -82,7 +82,7 @@ var changeHandler = new FailureMechanismPropertyChangeHandler(); // Call - void Call() => changeHandler.SetPropertyValueAfterConfirmation(new TestFailureMechanism(), 3, null); + void Call() => changeHandler.SetPropertyValueAfterConfirmation(new TestCalculatableFailureMechanism(), 3, null); // Assert string paramName = Assert.Throws(Call).ParamName; @@ -110,7 +110,7 @@ }; } - var testFailureMechanism = new TestFailureMechanism(testCase.Calculations); + var testFailureMechanism = new TestCalculatableFailureMechanism(testCase.Calculations); var propertySet = 0; var changeHandler = new FailureMechanismPropertyChangeHandler(); @@ -156,7 +156,7 @@ ICalculation calculationWithOutput = CalculationTestDataFactory.CreateCalculationWithOutput(); ICalculation calculationWithoutOutput = CalculationTestDataFactory.CreateCalculationWithoutOutput(); - var testFailureMechanism = new TestFailureMechanism( + var testFailureMechanism = new TestCalculatableFailureMechanism( new[] { calculationWithOutput, @@ -188,7 +188,7 @@ tester.ClickOk(); }; - var testFailureMechanism = new TestFailureMechanism( + var testFailureMechanism = new TestCalculatableFailureMechanism( new[] { CalculationTestDataFactory.CreateCalculationWithOutput() @@ -213,7 +213,7 @@ public void SetPropertyValueAfterConfirmation_ConfirmationNotRequiredExceptionInSetValue_ExceptionBubbled() { // Setup - var testFailureMechanism = new TestFailureMechanism(); + var testFailureMechanism = new TestCalculatableFailureMechanism(); var changeHandler = new FailureMechanismPropertyChangeHandler(); var expectedException = new Exception(); Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/MapLayers/CalculatableFailureMechanismSectionResultsMapLayerTest.cs =================================================================== diff -u -r8a38b10934f10fa56481a95212dbc9a8132bb02a -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/MapLayers/CalculatableFailureMechanismSectionResultsMapLayerTest.cs (.../CalculatableFailureMechanismSectionResultsMapLayerTest.cs) (revision 8a38b10934f10fa56481a95212dbc9a8132bb02a) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/MapLayers/CalculatableFailureMechanismSectionResultsMapLayerTest.cs (.../CalculatableFailureMechanismSectionResultsMapLayerTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -40,7 +40,7 @@ { // Setup var random = new Random(21); - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); failureMechanism.SetSections(new[] { FailureMechanismSectionTestFactory.CreateFailureMechanismSection() @@ -51,7 +51,7 @@ random.NextEnumValue()); // Call - using (var mapLayer = new CalculatableFailureMechanismSectionResultsMapLayer( + using (var mapLayer = new CalculatableFailureMechanismSectionResultsMapLayer( failureMechanism, result => assemblyResult)) { // Assert @@ -69,7 +69,7 @@ mocks.ReplayAll(); var random = new Random(21); - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); failureMechanism.SetSections(new[] { FailureMechanismSectionTestFactory.CreateFailureMechanismSection() @@ -79,7 +79,7 @@ random.NextDouble(), random.NextDouble(), random.NextDouble(), random.NextEnumValue()); - using (var mapLayer = new CalculatableFailureMechanismSectionResultsMapLayer( + using (var mapLayer = new CalculatableFailureMechanismSectionResultsMapLayer( failureMechanism, result => assemblyResult)) { mapLayer.MapData.Attach(observer); @@ -113,7 +113,7 @@ var random = new Random(21); var calculationScenario = new TestCalculationScenario(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculationScenario }); @@ -126,7 +126,7 @@ random.NextDouble(), random.NextDouble(), random.NextDouble(), random.NextEnumValue()); - using (var mapLayer = new CalculatableFailureMechanismSectionResultsMapLayer( + using (var mapLayer = new CalculatableFailureMechanismSectionResultsMapLayer( failureMechanism, result => assemblyResult)) { mapLayer.MapData.Attach(observer); @@ -160,7 +160,7 @@ var random = new Random(21); var calculationScenario = new TestCalculationScenario(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculationScenario }); @@ -173,7 +173,7 @@ random.NextDouble(), random.NextDouble(), random.NextDouble(), random.NextEnumValue()); - using (var mapLayer = new CalculatableFailureMechanismSectionResultsMapLayer( + using (var mapLayer = new CalculatableFailureMechanismSectionResultsMapLayer( failureMechanism, result => assemblyResult)) { mapLayer.MapData.Attach(observer); @@ -207,7 +207,7 @@ var random = new Random(21); var calculationScenario = new TestCalculationScenario(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculationScenario }); @@ -225,7 +225,7 @@ random.NextDouble(), random.NextDouble(), random.NextDouble(), random.NextEnumValue()); - using (var mapLayer = new CalculatableFailureMechanismSectionResultsMapLayer( + using (var mapLayer = new CalculatableFailureMechanismSectionResultsMapLayer( failureMechanism, result => assemblyResult)) { mapLayer.MapData.Attach(observer); Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Observers/CalculatableFailureMechanismResultObserverTest.cs =================================================================== diff -u -r8ae57441a1e2295827096795578b3bfb3ab9e1f1 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Observers/CalculatableFailureMechanismResultObserverTest.cs (.../CalculatableFailureMechanismResultObserverTest.cs) (revision 8ae57441a1e2295827096795578b3bfb3ab9e1f1) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Observers/CalculatableFailureMechanismResultObserverTest.cs (.../CalculatableFailureMechanismResultObserverTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -38,11 +38,11 @@ public void Constructor_WithFailureMechanism_ExpectedProperties() { // Call - using (var resultObserver = new CalculatableFailureMechanismResultObserver(new TestFailureMechanism())) + using (var resultObserver = new CalculatableFailureMechanismResultObserver(new TestCalculatableFailureMechanism())) { // Assert - Assert.IsInstanceOf>(resultObserver); } } @@ -51,13 +51,12 @@ public void GivenFailureMechanismResultObserverWithCalculationAndAttachedObserver_WhenCalculationNotifiesObservers_ThenAttachedObserverNotified() { // Given - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); var calculation = new TestCalculationWithInput(); failureMechanism.CalculationsGroup.Children.Add(calculation); - using (var resultObserver = new CalculatableFailureMechanismResultObserver(failureMechanism)) + using (var resultObserver = new CalculatableFailureMechanismResultObserver(failureMechanism)) { var mocks = new MockRepository(); var observer = mocks.StrictMock(); @@ -78,13 +77,12 @@ public void GivenFailureMechanismResultObserverWithCalculationAndAttachedObserver_WhenCalculationInputNotifiesObservers_ThenAttachedObserverNotified() { // Given - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); var calculation = new TestCalculationWithInput(); failureMechanism.CalculationsGroup.Children.Add(calculation); - using (var resultObserver = new CalculatableFailureMechanismResultObserver(failureMechanism)) + using (var resultObserver = new CalculatableFailureMechanismResultObserver(failureMechanism)) { var mocks = new MockRepository(); var observer = mocks.StrictMock(); Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Observers/FailureMechanismResultObserverTest.cs =================================================================== diff -u -r7161551b4eb7787dcf3f891a5d24b293e1c69ba0 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Observers/FailureMechanismResultObserverTest.cs (.../FailureMechanismResultObserverTest.cs) (revision 7161551b4eb7787dcf3f891a5d24b293e1c69ba0) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Observers/FailureMechanismResultObserverTest.cs (.../FailureMechanismResultObserverTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -37,7 +37,7 @@ public void Constructor_FailureMechanismNull_ThrowsArgumentNullException() { // Call - void Call() => new FailureMechanismResultObserver(null); + void Call() => new FailureMechanismResultObserver(null); // Assert var exception = Assert.Throws(Call); @@ -48,7 +48,8 @@ public void Constructor_WithFailureMechanism_ExpectedProperties() { // Call - using (var resultObserver = new FailureMechanismResultObserver(new TestFailurePath())) + using (var resultObserver = new FailureMechanismResultObserver( + new TestFailureMechanism())) { // Assert Assert.IsInstanceOf(resultObserver); @@ -65,8 +66,9 @@ observer.Expect(o => o.UpdateObserver()); mocks.ReplayAll(); - var failureMechanism = new TestFailurePath(); - using (var resultObserver = new FailureMechanismResultObserver(failureMechanism)) + var failureMechanism = new TestFailureMechanism(); + using (var resultObserver = new FailureMechanismResultObserver( + failureMechanism)) { resultObserver.Attach(observer); @@ -87,8 +89,9 @@ observer.Expect(o => o.UpdateObserver()); mocks.ReplayAll(); - var failureMechanism = new TestFailurePath(); - using (var resultObserver = new FailureMechanismResultObserver(failureMechanism)) + var failureMechanism = new TestFailureMechanism(); + using (var resultObserver = new FailureMechanismResultObserver( + failureMechanism)) { resultObserver.Attach(observer); @@ -109,13 +112,14 @@ observer.Expect(o => o.UpdateObserver()); mocks.ReplayAll(); - var failureMechanism = new TestFailurePath(); + var failureMechanism = new TestFailureMechanism(); FailureMechanismTestHelper.SetSections(failureMechanism, new[] { FailureMechanismSectionTestFactory.CreateFailureMechanismSection() }); - using (var resultObserver = new FailureMechanismResultObserver(failureMechanism)) + using (var resultObserver = new FailureMechanismResultObserver( + failureMechanism)) { resultObserver.Attach(observer); @@ -136,8 +140,9 @@ observer.Expect(o => o.UpdateObserver()); mocks.ReplayAll(); - var failureMechanism = new TestFailurePath(); - using (var resultObserver = new FailureMechanismResultObserver(failureMechanism)) + var failureMechanism = new TestFailureMechanism(); + using (var resultObserver = new FailureMechanismResultObserver( + failureMechanism)) { resultObserver.Attach(observer); Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/PresentationObjects/StructuresCalculationScenarioContextTest.cs =================================================================== diff -u -r96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/PresentationObjects/StructuresCalculationScenarioContextTest.cs (.../StructuresCalculationScenarioContextTest.cs) (revision 96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/PresentationObjects/StructuresCalculationScenarioContextTest.cs (.../StructuresCalculationScenarioContextTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -44,15 +44,15 @@ mocksRepository.ReplayAll(); var calculation = new TestStructuresCalculationScenario(); - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); var parent = new CalculationGroup(); // Call var context = new TestStructuresCalculationScenarioContext(calculation, parent, failureMechanism, assessmentSection); // Assert - Assert.IsInstanceOf, TestFailureMechanism>>(context); - Assert.IsInstanceOf, TestFailureMechanism>>(context); + Assert.IsInstanceOf, TestCalculatableFailureMechanism>>(context); + Assert.IsInstanceOf, TestCalculatableFailureMechanism>>(context); Assert.AreSame(calculation, context.WrappedData); Assert.AreSame(parent, context.Parent); Assert.AreSame(failureMechanism, context.FailureMechanism); @@ -69,7 +69,7 @@ mockRepository.ReplayAll(); var calculation = new TestStructuresCalculationScenario(); - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); // Call void Call() => new TestStructuresCalculationScenarioContext(calculation, null, failureMechanism, assessmentSection); @@ -87,7 +87,7 @@ private static readonly IAssessmentSection assessmentSection = mocks.Stub(); private static readonly TestStructuresCalculationScenario calculation = new TestStructuresCalculationScenario(); - private static readonly TestFailureMechanism failureMechanism = new TestFailureMechanism(); + private static readonly TestCalculatableFailureMechanism failureMechanism = new TestCalculatableFailureMechanism(); private static readonly CalculationGroup parent = new CalculationGroup(); [SetUp] @@ -127,11 +127,11 @@ } } - private class TestStructuresCalculationScenarioContext : StructuresCalculationScenarioContext + private class TestStructuresCalculationScenarioContext : StructuresCalculationScenarioContext { public TestStructuresCalculationScenarioContext(StructuresCalculationScenario calculation, CalculationGroup parent, - TestFailureMechanism failureMechanism, + TestCalculatableFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(calculation, parent, failureMechanism, assessmentSection) {} } @@ -140,7 +140,7 @@ { public DerivedTestStructuresCalculationScenarioContext(StructuresCalculationScenario calculation, CalculationGroup parent, - TestFailureMechanism failureMechanism, + TestCalculatableFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(calculation, parent, failureMechanism, assessmentSection) {} } Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/PropertyClasses/FailureMechanismSectionsProbabilityAssessmentPropertiesTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/PropertyClasses/FailureMechanismSectionsProbabilityAssessmentPropertiesTest.cs (.../FailureMechanismSectionsProbabilityAssessmentPropertiesTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/PropertyClasses/FailureMechanismSectionsProbabilityAssessmentPropertiesTest.cs (.../FailureMechanismSectionsProbabilityAssessmentPropertiesTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -48,11 +48,10 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => new FailureMechanismSectionsProbabilityAssessmentProperties(failureMechanism, - null); + void Call() => new FailureMechanismSectionsProbabilityAssessmentProperties(failureMechanism, null); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("probabilityAssessmentInput", exception.ParamName); mocks.VerifyAll(); } @@ -65,11 +64,10 @@ var probabilityAssessmentInput = new TestProbabilityAssessmentInput(random.NextDouble(), random.NextDouble()); // Call - TestDelegate call = () => new FailureMechanismSectionsProbabilityAssessmentProperties(null, - probabilityAssessmentInput); + void Call() => new FailureMechanismSectionsProbabilityAssessmentProperties(null, probabilityAssessmentInput); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); } @@ -90,8 +88,8 @@ failureMechanism.SetSections(sections, sourcePath); // Call - using (var properties = new FailureMechanismSectionsProbabilityAssessmentProperties(failureMechanism, - probabilityAssessmentInput)) + using (var properties = new FailureMechanismSectionsProbabilityAssessmentProperties( + failureMechanism, probabilityAssessmentInput)) { // Assert Assert.IsInstanceOf>(properties); @@ -135,8 +133,8 @@ var probabilityAssessmentInput = new TestProbabilityAssessmentInput(random.NextDouble(), random.NextDouble()); // Call - using (var properties = new FailureMechanismSectionsProbabilityAssessmentProperties(failureMechanism, - probabilityAssessmentInput)) + using (var properties = new FailureMechanismSectionsProbabilityAssessmentProperties( + failureMechanism, probabilityAssessmentInput)) { // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); @@ -169,8 +167,8 @@ var probabilityAssessmentInput = new TestProbabilityAssessmentInput(random.NextDouble(), random.NextDouble()); var failureMechanism = new TestFailureMechanism(); - using (var properties = new FailureMechanismSectionsProbabilityAssessmentProperties(failureMechanism, - probabilityAssessmentInput)) + using (var properties = new FailureMechanismSectionsProbabilityAssessmentProperties( + failureMechanism, probabilityAssessmentInput)) { var refreshRequiredRaised = 0; properties.RefreshRequired += (sender, args) => refreshRequiredRaised++; Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/PropertyClasses/FailureMechanismSectionsPropertiesTest.cs =================================================================== diff -u -re1facf62d5773e650ad953ce348c9072699152d0 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/PropertyClasses/FailureMechanismSectionsPropertiesTest.cs (.../FailureMechanismSectionsPropertiesTest.cs) (revision e1facf62d5773e650ad953ce348c9072699152d0) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/PropertyClasses/FailureMechanismSectionsPropertiesTest.cs (.../FailureMechanismSectionsPropertiesTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -59,16 +59,16 @@ FailureMechanismSectionTestFactory.CreateFailureMechanismSection() }; - var failurePath = new TestFailurePath(); - failurePath.SetSections(sections, sourcePath); + var failureMechanism = new TestFailureMechanism(); + failureMechanism.SetSections(sections, sourcePath); // Call - using (var properties = new FailureMechanismSectionsProperties(failurePath)) + using (var properties = new FailureMechanismSectionsProperties(failureMechanism)) { // Assert Assert.IsInstanceOf>(properties); Assert.IsInstanceOf(properties); - Assert.AreSame(failurePath, properties.Data); + Assert.AreSame(failureMechanism, properties.Data); TestHelper.AssertTypeConverter( nameof(FailureMechanismSectionsProperties.Sections)); @@ -129,7 +129,7 @@ public void GivenPropertyControlWithData_WhenFailureMechanismUpdated_RefreshRequiredEventRaised() { // Given - var failureMechanism = new TestFailurePath(); + var failureMechanism = new TestFailureMechanism(); using (var properties = new FailureMechanismSectionsProperties(failureMechanism)) { Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/TreeNodeInfos/RiskeerContextMenuBuilderTest.cs =================================================================== diff -u -r1656dcdbad8f28c0a84ec6636efe0004c62029d2 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/TreeNodeInfos/RiskeerContextMenuBuilderTest.cs (.../RiskeerContextMenuBuilderTest.cs) (revision 1656dcdbad8f28c0a84ec6636efe0004c62029d2) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/TreeNodeInfos/RiskeerContextMenuBuilderTest.cs (.../RiskeerContextMenuBuilderTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -1290,7 +1290,7 @@ } }; - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1336,7 +1336,7 @@ mocks.ReplayAll(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var parent = new CalculationGroup(); var calculationGroup = new CalculationGroup(); var calculationGroupContext = new TestCalculationGroupContext(calculationGroup, parent, failureMechanism); @@ -1392,7 +1392,7 @@ } }; - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1441,7 +1441,7 @@ mocks.ReplayAll(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var parent = new CalculationGroup(); var calculationGroup = new CalculationGroup(); var calculationGroupContext = new TestCalculationGroupContext(calculationGroup, parent, failureMechanism); @@ -1503,7 +1503,7 @@ } }; - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1549,7 +1549,7 @@ mocks.ReplayAll(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var parent = new CalculationGroup(); var calculationGroup = new CalculationGroup(); var calculationGroupContext = new TestCalculationGroupContext(calculationGroup, parent, failureMechanism); @@ -1605,7 +1605,7 @@ } }; - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1654,7 +1654,7 @@ mocks.ReplayAll(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var parent = new CalculationGroup(); var calculationGroup = new CalculationGroup(); var calculationGroupContext = new TestCalculationGroupContext(calculationGroup, parent, failureMechanism); @@ -1705,7 +1705,7 @@ var viewCommands = mocks.StrictMock(); var assessmentSection = mocks.StrictMock(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { new TestCalculation() }); @@ -1751,7 +1751,7 @@ var viewCommands = mocks.StrictMock(); var assessmentSection = mocks.StrictMock(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var failureMechanismContext = new TestFailureMechanismContext(failureMechanism, assessmentSection); mocks.ReplayAll(); @@ -1795,7 +1795,7 @@ var viewCommands = mocks.StrictMock(); var assessmentSection = mocks.StrictMock(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { new TestCalculation() }); @@ -1844,7 +1844,7 @@ var viewCommands = mocks.StrictMock(); var assessmentSection = mocks.StrictMock(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var failureMechanismContext = new TestFailureMechanismContext(failureMechanism, assessmentSection); mocks.ReplayAll(); @@ -1894,7 +1894,7 @@ var viewCommands = mocks.StrictMock(); var assessmentSection = mocks.StrictMock(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { new TestCalculation() }); @@ -1940,7 +1940,7 @@ var viewCommands = mocks.StrictMock(); var assessmentSection = mocks.StrictMock(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var failureMechanismContext = new TestFailureMechanismContext(failureMechanism, assessmentSection); mocks.ReplayAll(); @@ -1984,7 +1984,7 @@ var viewCommands = mocks.StrictMock(); var assessmentSection = mocks.StrictMock(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { new TestCalculation() }); @@ -2036,7 +2036,7 @@ var viewCommands = mocks.StrictMock(); var assessmentSection = mocks.StrictMock(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var failureMechanismContext = new TestFailureMechanismContext(failureMechanism, assessmentSection); mocks.ReplayAll(); Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/TreeNodeInfos/RiskeerContextMenuItemFactoryTest.cs =================================================================== diff -u -r1656dcdbad8f28c0a84ec6636efe0004c62029d2 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/TreeNodeInfos/RiskeerContextMenuItemFactoryTest.cs (.../RiskeerContextMenuItemFactoryTest.cs) (revision 1656dcdbad8f28c0a84ec6636efe0004c62029d2) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/TreeNodeInfos/RiskeerContextMenuItemFactoryTest.cs (.../RiskeerContextMenuItemFactoryTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -378,7 +378,7 @@ calculationWithOutputMock2.Expect(c => c.ClearOutput()); calculationWithOutputMock2.Expect(c => c.NotifyObservers()); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculationWithOutputMock1, calculationWithOutputMock2, @@ -1149,7 +1149,7 @@ }; var parent = new CalculationGroup(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1170,7 +1170,7 @@ public void CreatePerformAllCalculationsInGroupItem_GeneralValidationFalseAdditionalValidationNull_CreatesDisabledItemAndSetGeneralValidationMessageTooltip() { // Setup - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var nestedGroup = new CalculationGroup(); var parent = new CalculationGroup(); @@ -1207,7 +1207,7 @@ }; var parent = new CalculationGroup(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1230,7 +1230,7 @@ public void CreatePerformAllCalculationsInGroupItem_GeneralValidationFalseAdditionalValidationContainsMessage_CreatesDisabledItemAndSetGeneralValidationMessageTooltip() { // Setup - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var parent = new CalculationGroup(); var calculationGroup = new CalculationGroup(); @@ -1253,7 +1253,7 @@ { // Setup var calculation = new TestCalculation(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1297,7 +1297,7 @@ }; var parent = new CalculationGroup(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1318,7 +1318,7 @@ public void CreateValidateAllCalculationsInGroupItem_GeneralValidationFalseAdditionalValidationNull_CreatesDisabledItemAndSetGeneralValidationMessageTooltip() { // Setup - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var nestedGroup = new CalculationGroup(); var parent = new CalculationGroup(); @@ -1355,7 +1355,7 @@ }; var parent = new CalculationGroup(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1378,7 +1378,7 @@ public void CreateValidateAllCalculationsInGroupItem_GeneralValidationFalseAdditionalValidationContainsMessage_CreatesDisabledItemAndSetGeneralValidationMessageTooltip() { // Setup - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var parent = new CalculationGroup(); var calculationGroup = new CalculationGroup(); @@ -1401,7 +1401,7 @@ { // Setup var calculation = new TestCalculation(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1443,7 +1443,7 @@ mocks.ReplayAll(); var calculation = new TestCalculation(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1468,7 +1468,7 @@ var assessmentSection = mocks.StrictMock(); mocks.ReplayAll(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var failureMechanismContext = new TestFailureMechanismContext(failureMechanism, assessmentSection); @@ -1493,7 +1493,7 @@ var calculation = new TestCalculation(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1520,7 +1520,7 @@ var assessmentSection = mocks.StrictMock(); mocks.ReplayAll(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var failureMechanismContext = new TestFailureMechanismContext(failureMechanism, assessmentSection); const string errorMessage = "Additional check failed."; @@ -1546,7 +1546,7 @@ mocks.ReplayAll(); var counter = 0; - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1574,7 +1574,7 @@ mocks.ReplayAll(); var calculation = new TestCalculation(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1602,7 +1602,7 @@ var assessmentSection = mocks.StrictMock(); mocks.ReplayAll(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var failureMechanismContext = new TestFailureMechanismContext(failureMechanism, assessmentSection); // Call @@ -1626,7 +1626,7 @@ var calculation = new TestCalculation(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -1656,7 +1656,7 @@ var assessmentSection = mocks.StrictMock(); mocks.ReplayAll(); - var failureMechanism = new TestFailureMechanism(Enumerable.Empty()); + var failureMechanism = new TestCalculatableFailureMechanism(Enumerable.Empty()); var failureMechanismContext = new TestFailureMechanismContext(failureMechanism, assessmentSection); const string errorMessage = "Additional check failed."; @@ -1685,7 +1685,7 @@ mocks.ReplayAll(); var counter = 0; - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/CalculationsViewTest.cs =================================================================== diff -u -r87236188a4f963e5be91f574d16487f683d9b27b -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/CalculationsViewTest.cs (.../CalculationsViewTest.cs) (revision 87236188a4f963e5be91f574d16487f683d9b27b) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/CalculationsViewTest.cs (.../CalculationsViewTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -85,7 +85,7 @@ public void GivenCalculationsView_WhenGenerateCalculationsButtonClicked_ThenGenerateCalculationsCalled() { // Given - var view = new TestCalculationsView(new CalculationGroup(), new TestFailureMechanism(), new AssessmentSectionStub()) + var view = new TestCalculationsView(new CalculationGroup(), new TestCalculatableFailureMechanism(), new AssessmentSectionStub()) { CanGenerateCalculationState = true }; @@ -184,10 +184,10 @@ { ConfigureHydraulicBoundaryDatabase(assessmentSection); - return ShowCalculationsView(ConfigureCalculationGroup(assessmentSection), new TestFailureMechanism(), assessmentSection); + return ShowCalculationsView(ConfigureCalculationGroup(assessmentSection), new TestCalculatableFailureMechanism(), assessmentSection); } - private TestCalculationsView ShowCalculationsView(CalculationGroup calculationGroup, TestFailureMechanism failureMechanism, IAssessmentSection assessmentSection) + private TestCalculationsView ShowCalculationsView(CalculationGroup calculationGroup, TestCalculatableFailureMechanism failureMechanism, IAssessmentSection assessmentSection) { var calculationsView = new TestCalculationsView(calculationGroup, failureMechanism, assessmentSection); @@ -197,10 +197,10 @@ return calculationsView; } - private abstract class TestCalculationsViewBase : CalculationsView + private abstract class TestCalculationsViewBase : CalculationsView where TCalculationRow : CalculationRow { - protected TestCalculationsViewBase(CalculationGroup calculationGroup, TestFailureMechanism failureMechanism, IAssessmentSection assessmentSection) + protected TestCalculationsViewBase(CalculationGroup calculationGroup, TestCalculatableFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(calculationGroup, failureMechanism, assessmentSection) {} public bool CanGenerateCalculationState { get; set; } @@ -240,7 +240,7 @@ private class TestCalculationsView : TestCalculationsViewBase { - public TestCalculationsView(CalculationGroup calculationGroup, TestFailureMechanism failureMechanism, IAssessmentSection assessmentSection) + public TestCalculationsView(CalculationGroup calculationGroup, TestCalculatableFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(calculationGroup, failureMechanism, assessmentSection) {} public int HydraulicBoundaryLocationChangedCounter { get; private set; } @@ -272,7 +272,7 @@ private class MissingNameColumnTestCalculationsView : TestCalculationsViewBase { - public MissingNameColumnTestCalculationsView(CalculationGroup calculationGroup, TestFailureMechanism failureMechanism, IAssessmentSection assessmentSection) + public MissingNameColumnTestCalculationsView(CalculationGroup calculationGroup, TestCalculatableFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(calculationGroup, failureMechanism, assessmentSection) {} protected override TestCalculationRow CreateRow(TestCalculation calculation) @@ -288,7 +288,7 @@ private class MissingHydraulicBoundaryLocationTestCalculationsView : TestCalculationsViewBase { - public MissingHydraulicBoundaryLocationTestCalculationsView(CalculationGroup calculationGroup, TestFailureMechanism failureMechanism, IAssessmentSection assessmentSection) + public MissingHydraulicBoundaryLocationTestCalculationsView(CalculationGroup calculationGroup, TestCalculatableFailureMechanism failureMechanism, IAssessmentSection assessmentSection) : base(calculationGroup, failureMechanism, assessmentSection) {} protected override TestCalculationRow CreateRow(TestCalculation calculation) @@ -313,7 +313,7 @@ mocks.ReplayAll(); // Call - void Call() => new TestCalculationsView(null, new TestFailureMechanism(), assessmentSection); + void Call() => new TestCalculationsView(null, new TestCalculatableFailureMechanism(), assessmentSection); // Assert var exception = Assert.Throws(Call); @@ -342,7 +342,7 @@ public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - void Call() => new TestCalculationsView(new CalculationGroup(), new TestFailureMechanism(), null); + void Call() => new TestCalculationsView(new CalculationGroup(), new TestCalculatableFailureMechanism(), null); // Assert var exception = Assert.Throws(Call); @@ -353,7 +353,7 @@ public void Constructor_ExpectedValues() { // Call - TestCalculationsView view = ShowCalculationsView(new CalculationGroup(), new TestFailureMechanism(), new AssessmentSectionStub()); + TestCalculationsView view = ShowCalculationsView(new CalculationGroup(), new TestCalculatableFailureMechanism(), new AssessmentSectionStub()); // Assert Assert.IsInstanceOf(view); @@ -374,7 +374,7 @@ mocks.ReplayAll(); // Call - ShowCalculationsView(ConfigureCalculationGroup(assessmentSection), new TestFailureMechanism(), assessmentSection); + ShowCalculationsView(ConfigureCalculationGroup(assessmentSection), new TestCalculatableFailureMechanism(), assessmentSection); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; @@ -415,7 +415,7 @@ mocks.ReplayAll(); // Call - ShowCalculationsView(ConfigureCalculationGroup(assessmentSection), new TestFailureMechanism(), assessmentSection); + ShowCalculationsView(ConfigureCalculationGroup(assessmentSection), new TestCalculatableFailureMechanism(), assessmentSection); // Assert var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; @@ -434,7 +434,7 @@ public void Constructor_IncorrectNameIndex_ThrowsInvalidOperationException() { // Call - void Call() => new MissingNameColumnTestCalculationsView(new CalculationGroup(), new TestFailureMechanism(), new AssessmentSectionStub()); + void Call() => new MissingNameColumnTestCalculationsView(new CalculationGroup(), new TestCalculatableFailureMechanism(), new AssessmentSectionStub()); // Assert var exception = Assert.Throws(Call); @@ -445,7 +445,7 @@ public void Constructor_IncorrectHydraulicBoundaryLocationIndex_ThrowsInvalidOperationException() { // Call - void Call() => new MissingHydraulicBoundaryLocationTestCalculationsView(new CalculationGroup(), new TestFailureMechanism(), new AssessmentSectionStub()); + void Call() => new MissingHydraulicBoundaryLocationTestCalculationsView(new CalculationGroup(), new TestCalculatableFailureMechanism(), new AssessmentSectionStub()); // Assert var exception = Assert.Throws(Call); @@ -458,7 +458,7 @@ public void GenerateButton_Always_HasCorrectState(bool state) { // Setup - var view = new TestCalculationsView(new CalculationGroup(), new TestFailureMechanism(), new AssessmentSectionStub()) + var view = new TestCalculationsView(new CalculationGroup(), new TestCalculatableFailureMechanism(), new AssessmentSectionStub()) { CanGenerateCalculationState = state }; @@ -536,7 +536,7 @@ ConfigureHydraulicBoundaryDatabase(assessmentSection); mocks.ReplayAll(); - ShowCalculationsView(ConfigureCalculationGroup(assessmentSection), new TestFailureMechanism(), assessmentSection); + ShowCalculationsView(ConfigureCalculationGroup(assessmentSection), new TestCalculatableFailureMechanism(), assessmentSection); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; var hydraulicBoundaryLocationCombobox = (DataGridViewComboBoxColumn) dataGridView.Columns[selectableHydraulicBoundaryLocationsColumnIndex]; @@ -572,7 +572,7 @@ CalculationGroup calculationGroup = ConfigureCalculationGroup(assessmentSection); - ShowCalculationsView(calculationGroup, new TestFailureMechanism(), assessmentSection); + ShowCalculationsView(calculationGroup, new TestCalculatableFailureMechanism(), assessmentSection); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; var dataSourceUpdated = 0; @@ -601,7 +601,7 @@ CalculationGroup calculationGroup = ConfigureCalculationGroup(assessmentSection); - ShowCalculationsView(calculationGroup, new TestFailureMechanism(), assessmentSection); + ShowCalculationsView(calculationGroup, new TestCalculatableFailureMechanism(), assessmentSection); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; var invalidated = 0; @@ -629,7 +629,7 @@ CalculationGroup calculationGroup = ConfigureCalculationGroup(assessmentSection); - ShowCalculationsView(calculationGroup, new TestFailureMechanism(), assessmentSection); + ShowCalculationsView(calculationGroup, new TestCalculatableFailureMechanism(), assessmentSection); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; var dataSourceUpdated = 0; @@ -686,7 +686,7 @@ private readonly bool initialReadOnlyState; public TestCalculationsViewWithColumnStateDefinitions(CalculationGroup calculationGroup, - TestFailureMechanism failureMechanism, + TestCalculatableFailureMechanism failureMechanism, IAssessmentSection assessmentSection, bool initialReadOnlyState) : base(calculationGroup, failureMechanism, assessmentSection) @@ -707,7 +707,7 @@ ConfigureHydraulicBoundaryDatabase(assessmentSection); var calculationsView = new TestCalculationsViewWithColumnStateDefinitions(ConfigureCalculationGroup(assessmentSection), - new TestFailureMechanism(), + new TestCalculatableFailureMechanism(), assessmentSection, initialReadOnlyState); Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/FailureMechanismSectionsViewTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/FailureMechanismSectionsViewTest.cs (.../FailureMechanismSectionsViewTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/FailureMechanismSectionsViewTest.cs (.../FailureMechanismSectionsViewTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -63,11 +63,11 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); mocks.ReplayAll(); // Call - void Call() => new FailureMechanismSectionsView(null, failurePath); + void Call() => new FailureMechanismSectionsView(null, failureMechanism); // Assert string paramName = Assert.Throws(Call).ParamName; @@ -81,18 +81,18 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); mocks.ReplayAll(); IEnumerable sections = Enumerable.Empty(); // Call - using (FailureMechanismSectionsView view = ShowFailureMechanismSectionsView(sections, failurePath)) + using (FailureMechanismSectionsView view = ShowFailureMechanismSectionsView(sections, failureMechanism)) { // Assert Assert.IsInstanceOf(view); Assert.IsNull(view.Data); - Assert.AreSame(failurePath, view.FailurePath); + Assert.AreSame(failureMechanism, view.FailurePath); Assert.AreEqual(1, view.Controls.Count); DataGridViewControl sectionsDataGridViewControl = GetSectionsDataGridViewControl(view); @@ -116,13 +116,13 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); mocks.ReplayAll(); IEnumerable sections = Enumerable.Empty(); // Call - using (FailureMechanismSectionsView view = ShowFailureMechanismSectionsView(sections, failurePath)) + using (FailureMechanismSectionsView view = ShowFailureMechanismSectionsView(sections, failureMechanism)) { // Assert CollectionAssert.IsEmpty(GetSectionsDataGridViewControl(view).Rows); @@ -136,7 +136,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); mocks.ReplayAll(); FailureMechanismSection[] sections = @@ -147,7 +147,7 @@ }; // Call - using (FailureMechanismSectionsView view = ShowFailureMechanismSectionsView(sections, failurePath)) + using (FailureMechanismSectionsView view = ShowFailureMechanismSectionsView(sections, failureMechanism)) { // Assert DataGridViewControl sectionsDataGridViewControl = GetSectionsDataGridViewControl(view); @@ -162,42 +162,42 @@ public void GivenViewWithSections_WhenFailureMechanismNotifiesChangeAndSectionsUpdated_ThenDataGridViewUpdated() { // Given - var failurePath = new TestFailurePath(); - FailureMechanismTestHelper.SetSections(failurePath, new[] + var failureMechanism = new TestFailureMechanism(); + FailureMechanismTestHelper.SetSections(failureMechanism, new[] { CreateFailureMechanismSection("a") }); - using (FailureMechanismSectionsView view = ShowFailureMechanismSectionsView(failurePath.Sections, failurePath)) + using (FailureMechanismSectionsView view = ShowFailureMechanismSectionsView(failureMechanism.Sections, failureMechanism)) { DataGridViewControl sectionsDataGridViewControl = GetSectionsDataGridViewControl(view); // Precondition - AssertSectionsDataGridViewControl(failurePath.Sections.ToArray(), sectionsDataGridViewControl); + AssertSectionsDataGridViewControl(failureMechanism.Sections.ToArray(), sectionsDataGridViewControl); // When - FailureMechanismTestHelper.SetSections(failurePath, new[] + FailureMechanismTestHelper.SetSections(failureMechanism, new[] { FailureMechanismSectionTestFactory.CreateFailureMechanismSection() }); - failurePath.NotifyObservers(); + failureMechanism.NotifyObservers(); // Then - AssertSectionsDataGridViewControl(failurePath.Sections.ToArray(), sectionsDataGridViewControl); + AssertSectionsDataGridViewControl(failureMechanism.Sections.ToArray(), sectionsDataGridViewControl); } } [Test] public void GivenViewWithSections_WhenFailureMechanismNotifiesChangeAndSectionsNotUpdated_ThenDataGridViewNotUpdated() { // Given - var failurePath = new TestFailurePath(); - FailureMechanismTestHelper.SetSections(failurePath, new[] + var failureMechanism = new TestFailureMechanism(); + FailureMechanismTestHelper.SetSections(failureMechanism, new[] { CreateFailureMechanismSection("a") }); - using (FailureMechanismSectionsView view = ShowFailureMechanismSectionsView(failurePath.Sections, failurePath)) + using (FailureMechanismSectionsView view = ShowFailureMechanismSectionsView(failureMechanism.Sections, failureMechanism)) { DataGridView sectionsDataGridView = GetSectionsDataGridView(view); @@ -209,7 +209,7 @@ }; // When - failurePath.NotifyObservers(); + failureMechanism.NotifyObservers(); // Then Assert.IsFalse(invalidated); @@ -263,9 +263,9 @@ } private FailureMechanismSectionsView ShowFailureMechanismSectionsView(IEnumerable sections, - IFailureMechanism failurePath) + IFailureMechanism failureMechanism) { - var view = new FailureMechanismSectionsView(sections, failurePath); + var view = new FailureMechanismSectionsView(sections, failureMechanism); testForm.Controls.Add(view); testForm.Show(); Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/ScenariosViewTest.cs =================================================================== diff -u -r96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/ScenariosViewTest.cs (.../ScenariosViewTest.cs) (revision 96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/ScenariosViewTest.cs (.../ScenariosViewTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -64,7 +64,7 @@ public void Constructor_CalculationGroupNull_ThrowsArgumentNullException() { // Call - void Call() => new TestScenariosView(null, new TestFailureMechanism()); + void Call() => new TestScenariosView(null, new TestCalculatableFailureMechanism()); // Assert var exception = Assert.Throws(Call); @@ -89,7 +89,7 @@ var calculationGroup = new CalculationGroup(); // Call - using (var view = new TestScenariosView(calculationGroup, new TestFailureMechanism())) + using (var view = new TestScenariosView(calculationGroup, new TestCalculatableFailureMechanism())) { // Assert Assert.IsInstanceOf(view); @@ -102,7 +102,7 @@ public void Constructor_ListBoxCorrectlyInitialized() { // Setup - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); var failureMechanismSection1 = new FailureMechanismSection("Section 1", new[] { new Point2D(0.0, 0.0), @@ -143,7 +143,7 @@ public void Constructor_DataGridViewCorrectlyInitialized() { // Call - ShowFullyConfiguredScenariosView(new CalculationGroup(), new TestFailureMechanism()); + ShowFullyConfiguredScenariosView(new CalculationGroup(), new TestCalculatableFailureMechanism()); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; @@ -177,7 +177,7 @@ public void ScenariosView_ContributionValueInvalid_ShowsErrorTooltip() { // Setup - ShowFullyConfiguredScenariosView(new CalculationGroup(), new TestFailureMechanism()); + ShowFullyConfiguredScenariosView(new CalculationGroup(), new TestCalculatableFailureMechanism()); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; @@ -196,7 +196,7 @@ public void ScenariosView_EditValueValid_DoNotShowErrorToolTipAndEditValue(double newValue) { // Setup - ShowFullyConfiguredScenariosView(new CalculationGroup(), new TestFailureMechanism()); + ShowFullyConfiguredScenariosView(new CalculationGroup(), new TestCalculatableFailureMechanism()); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; @@ -219,7 +219,7 @@ mocks.ReplayAll(); var calculationGroup = new CalculationGroup(); - ShowFullyConfiguredScenariosView(calculationGroup, new TestFailureMechanism()); + ShowFullyConfiguredScenariosView(calculationGroup, new TestCalculatableFailureMechanism()); ICalculation calculation = calculationGroup.GetCalculations().First(); calculation.Attach(calculationObserver); @@ -237,7 +237,7 @@ public void GivenScenariosView_WhenSelectingDifferentItemInSectionsListBox_ThenDataGridViewUpdated() { // Given - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); ShowFullyConfiguredScenariosView(new CalculationGroup(), failureMechanism); var listBox = (ListBox) new ControlTester("listBox").TheObject; @@ -267,7 +267,7 @@ public void GivenScenariosView_WhenFailureMechanismNotifiesObserver_ThenSectionsListBoxCorrectlyUpdated() { // Given - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); ShowScenariosView(new CalculationGroup(), failureMechanism); var listBox = (ListBox) new ControlTester("listBox").TheObject; @@ -312,7 +312,7 @@ public void GivenScenariosView_WhenFailureMechanismNotifiesObserver_ThenDataGridViewUpdated() { // Given - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); ShowFullyConfiguredScenariosView(new CalculationGroup(), failureMechanism); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; @@ -339,7 +339,7 @@ { // Given var calculationGroup = new CalculationGroup(); - ShowFullyConfiguredScenariosView(calculationGroup, new TestFailureMechanism()); + ShowFullyConfiguredScenariosView(calculationGroup, new TestCalculatableFailureMechanism()); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; @@ -365,7 +365,7 @@ { // Given var calculationGroup = new CalculationGroup(); - ShowFullyConfiguredScenariosView(calculationGroup, new TestFailureMechanism()); + ShowFullyConfiguredScenariosView(calculationGroup, new TestCalculatableFailureMechanism()); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; var refreshed = 0; @@ -395,7 +395,7 @@ { // Given var calculationGroup = new CalculationGroup(); - ShowFullyConfiguredScenariosView(calculationGroup, new TestFailureMechanism()); + ShowFullyConfiguredScenariosView(calculationGroup, new TestCalculatableFailureMechanism()); var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; @@ -418,7 +418,7 @@ CollectionAssert.AreNotEquivalent(sectionResultRows, updatedRows); } - private void ShowFullyConfiguredScenariosView(CalculationGroup calculationGroup, TestFailureMechanism failureMechanism) + private void ShowFullyConfiguredScenariosView(CalculationGroup calculationGroup, TestCalculatableFailureMechanism failureMechanism) { FailureMechanismTestHelper.SetSections(failureMechanism, new[] { @@ -450,17 +450,17 @@ ShowScenariosView(calculationGroup, failureMechanism); } - private void ShowScenariosView(CalculationGroup calculationGroup, TestFailureMechanism failureMechanism) + private void ShowScenariosView(CalculationGroup calculationGroup, TestCalculatableFailureMechanism failureMechanism) { var scenariosView = new TestScenariosView(calculationGroup, failureMechanism); testForm.Controls.Add(scenariosView); testForm.Show(); } - private class TestScenariosView : ScenariosView + private class TestScenariosView : ScenariosView { - public TestScenariosView(CalculationGroup calculationGroup, TestFailureMechanism failureMechanism) + public TestScenariosView(CalculationGroup calculationGroup, TestCalculatableFailureMechanism failureMechanism) : base(calculationGroup, failureMechanism) {} protected override TestCalculationInput GetCalculationInput(TestCalculationScenario calculationScenario) Index: Riskeer/Common/test/Riskeer.Common.IO.Test/FileImporters/FailureMechanismSectionReplaceStrategyTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.IO.Test/FileImporters/FailureMechanismSectionReplaceStrategyTest.cs (.../FailureMechanismSectionReplaceStrategyTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Common/test/Riskeer.Common.IO.Test/FileImporters/FailureMechanismSectionReplaceStrategyTest.cs (.../FailureMechanismSectionReplaceStrategyTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -1,4 +1,4 @@ -// Copyright (C) Stichting Deltares 2021. All rights reserved. +// Copyright (C) Stichting Deltares 2021. All rights reserved. // // This file is part of Riskeer. // @@ -38,26 +38,26 @@ public class FailureMechanismSectionReplaceStrategyTest { [Test] - public void Constructor_FailurePathNull_ThrowsArgumentNullException() + public void Constructor_FailureMechanismNull_ThrowsArgumentNullException() { // Call void Call() => new FailureMechanismSectionReplaceStrategy(null); // Assert var exception = Assert.Throws(Call); - Assert.AreEqual("failurePath", exception.ParamName); + Assert.AreEqual("failureMechanism", exception.ParamName); } [Test] public void Constructor_ExpectedValues() { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub>(); + var failureMechanism = mocks.Stub>(); mocks.ReplayAll(); // Call - var importer = new FailureMechanismSectionReplaceStrategy(failurePath); + var importer = new FailureMechanismSectionReplaceStrategy(failureMechanism); // Assert Assert.IsInstanceOf(importer); @@ -69,11 +69,11 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub>(); + var failureMechanism = mocks.Stub>(); mocks.ReplayAll(); // Call - void Call() => new FailureMechanismSectionReplaceStrategy(failurePath).UpdateSectionsWithImportedData(null, ""); + void Call() => new FailureMechanismSectionReplaceStrategy(failureMechanism).UpdateSectionsWithImportedData(null, ""); // Assert var exception = Assert.Throws(Call); @@ -86,10 +86,10 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub>(); + var failureMechanism = mocks.Stub>(); mocks.ReplayAll(); - var failureMechanismSectionReplaceStrategy = new FailureMechanismSectionReplaceStrategy(failurePath); + var failureMechanismSectionReplaceStrategy = new FailureMechanismSectionReplaceStrategy(failureMechanism); // Call void Call() => failureMechanismSectionReplaceStrategy.UpdateSectionsWithImportedData(Enumerable.Empty(), null); @@ -131,7 +131,7 @@ // Setup string sourcePath = TestHelper.GetScratchPadPath(); - var failurePath = new TestFailurePath(); + var failureMechanism = new TestFailureMechanism(); FailureMechanismSection failureMechanismSection1 = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(new[] { new Point2D(0.0, 0.0), @@ -143,7 +143,7 @@ new Point2D(15.0, 15.0) }); - var failureMechanismSectionReplaceStrategy = new FailureMechanismSectionReplaceStrategy(failurePath); + var failureMechanismSectionReplaceStrategy = new FailureMechanismSectionReplaceStrategy(failureMechanism); FailureMechanismSection[] sections = { @@ -167,38 +167,38 @@ const string oldSourcePath = "old/path"; string sourcePath = TestHelper.GetScratchPadPath(); - var failurePath = new TestFailurePath(); - failurePath.SetSections(new[] + var failureMechanism = new TestFailureMechanism(); + failureMechanism.SetSections(new[] { FailureMechanismSectionTestFactory.CreateFailureMechanismSection() }, oldSourcePath); - var failureMechanismSectionReplaceStrategy = new FailureMechanismSectionReplaceStrategy(failurePath); + var failureMechanismSectionReplaceStrategy = new FailureMechanismSectionReplaceStrategy(failureMechanism); // Precondition - IEnumerable failureMechanismSections = failurePath.Sections; + IEnumerable failureMechanismSections = failureMechanism.Sections; Assert.AreEqual(1, failureMechanismSections.Count()); - Assert.AreEqual(oldSourcePath, failurePath.FailureMechanismSectionSourcePath); + Assert.AreEqual(oldSourcePath, failureMechanism.FailureMechanismSectionSourcePath); // Call IEnumerable affectedObjects = failureMechanismSectionReplaceStrategy.UpdateSectionsWithImportedData(Enumerable.Empty(), sourcePath); // Assert - Assert.AreEqual(sourcePath, failurePath.FailureMechanismSectionSourcePath); + Assert.AreEqual(sourcePath, failureMechanism.FailureMechanismSectionSourcePath); Assert.IsEmpty(failureMechanismSections); CollectionAssert.AreEqual(new IObservable[] { - failurePath, - failurePath.SectionResults + failureMechanism, + failureMechanism.SectionResults }, affectedObjects); } [Test] public void DoPostUpdateActions_Always_ReturnsEmptyCollection() { // Setup - var failurePath = new TestFailurePath(); - var failureMechanismSectionReplaceStrategy = new FailureMechanismSectionReplaceStrategy(failurePath); + var failureMechanism = new TestFailureMechanism(); + var failureMechanismSectionReplaceStrategy = new FailureMechanismSectionReplaceStrategy(failureMechanism); // Call IEnumerable affectedObjects = failureMechanismSectionReplaceStrategy.DoPostUpdateActions(); Index: Riskeer/Common/test/Riskeer.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs (.../FailureMechanismSectionsImporterTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Common/test/Riskeer.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs (.../FailureMechanismSectionsImporterTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -52,13 +52,13 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.Stub(); var messageProvider = mocks.StrictMock(); mocks.ReplayAll(); // Call - void Call() => new FailureMechanismSectionsImporter(failurePath, null, "", updateStrategy, messageProvider); + void Call() => new FailureMechanismSectionsImporter(failureMechanism, null, "", updateStrategy, messageProvider); // Assert var exception = Assert.Throws(Call); @@ -71,12 +71,12 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var messageProvider = mocks.StrictMock(); mocks.ReplayAll(); // Call - void Call() => new FailureMechanismSectionsImporter(failurePath, new ReferenceLine(), "", null, messageProvider); + void Call() => new FailureMechanismSectionsImporter(failureMechanism, new ReferenceLine(), "", null, messageProvider); // Assert var exception = Assert.Throws(Call); @@ -89,12 +89,12 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.Stub(); mocks.ReplayAll(); // Call - void Call() => new FailureMechanismSectionsImporter(failurePath, new ReferenceLine(), "", updateStrategy, null); + void Call() => new FailureMechanismSectionsImporter(failureMechanism, new ReferenceLine(), "", updateStrategy, null); // Assert var exception = Assert.Throws(Call); @@ -107,15 +107,15 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.Stub(); var messageProvider = mocks.StrictMock(); mocks.ReplayAll(); var referenceLine = new ReferenceLine(); // Call - var importer = new FailureMechanismSectionsImporter(failurePath, referenceLine, "", updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, referenceLine, "", updateStrategy, messageProvider); // Assert Assert.IsInstanceOf>(importer); @@ -135,7 +135,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); updateStrategy.Expect(us => us.UpdateSectionsWithImportedData(null, null)) .IgnoreArguments() @@ -151,7 +151,7 @@ var messageProvider = mocks.Stub(); mocks.ReplayAll(); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); // Call bool importSuccessful = importer.Import(); @@ -178,7 +178,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); updateStrategy.Expect(us => us.UpdateSectionsWithImportedData(null, null)) .IgnoreArguments() @@ -193,7 +193,7 @@ var messageProvider = mocks.Stub(); mocks.ReplayAll(); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); // Call bool importSuccessful = importer.Import(); @@ -208,7 +208,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.Stub(); updateStrategy.Stub(us => us.UpdateSectionsWithImportedData(null, null)) .IgnoreArguments() @@ -226,7 +226,7 @@ var progressChangeNotifications = new List(); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); importer.SetProgressChanged((description, step, steps) => progressChangeNotifications.Add(new ProgressNotification(description, step, steps))); // Call @@ -251,7 +251,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); var messageProvider = mocks.StrictMock(); messageProvider.Expect(mp => mp.GetUpdateDataFailedLogMessageText(sectionsTypeDescriptor)).Return(expectedUpdateDataFailedText); @@ -263,7 +263,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); // Call var importSuccessful = true; @@ -282,7 +282,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); var messageProvider = mocks.StrictMock(); messageProvider.Expect(mp => mp.GetUpdateDataFailedLogMessageText(sectionsTypeDescriptor)).Return(expectedUpdateDataFailedText); @@ -294,7 +294,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); // Call var importSuccessful = true; @@ -313,7 +313,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); var messageProvider = mocks.StrictMock(); messageProvider.Expect(mp => mp.GetUpdateDataFailedLogMessageText(sectionsTypeDescriptor)).Return(expectedUpdateDataFailedText); @@ -326,7 +326,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); // Call var importSuccessful = true; @@ -346,7 +346,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); var messageProvider = mocks.StrictMock(); messageProvider.Expect(mp => mp.GetUpdateDataFailedLogMessageText(sectionsTypeDescriptor)).Return(expectedUpdateDataFailedText); @@ -360,7 +360,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); // Call var importSuccessful = true; @@ -381,7 +381,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); var messageProvider = mocks.StrictMock(); messageProvider.Expect(mp => mp.GetUpdateDataFailedLogMessageText(sectionsTypeDescriptor)).Return(expectedUpdateDataFailedText); @@ -395,7 +395,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); // Call var importSuccessful = true; @@ -414,7 +414,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); var messageProvider = mocks.StrictMock(); messageProvider.Expect(mp => mp.GetUpdateDataFailedLogMessageText(sectionsTypeDescriptor)).Return(expectedUpdateDataFailedText); @@ -427,7 +427,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); // Call var importSuccessful = true; @@ -445,7 +445,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); var messageProvider = mocks.StrictMock(); messageProvider.Expect(mp => mp.GetUpdateDataFailedLogMessageText(sectionsTypeDescriptor)).Return(expectedUpdateDataFailedText); @@ -458,7 +458,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); // Call var importSuccessful = true; @@ -476,7 +476,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); var messageProvider = mocks.StrictMock(); messageProvider.Expect(mp => mp.GetUpdateDataFailedLogMessageText(sectionsTypeDescriptor)).Return(expectedUpdateDataFailedText); @@ -489,7 +489,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); // Call var importSuccessful = true; @@ -507,15 +507,15 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); var messageProvider = mocks.StrictMock(); mocks.ReplayAll(); string sectionsFilePath = TestHelper.GetTestDataPath(TestDataPath.Riskeer.Common.IO, Path.Combine("FailureMechanismSections", "vakindeling_Empty_Name_Value.shp")); - var importer = new FailureMechanismSectionsImporter(failurePath, new ReferenceLine(), sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, new ReferenceLine(), sectionsFilePath, updateStrategy, messageProvider); // Call var importSuccessful = true; @@ -533,7 +533,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); var messageProvider = mocks.StrictMock(); messageProvider.Expect(mp => mp.GetCancelledLogMessageText(sectionsTypeDescriptor)).Return(expectedCancelledText); @@ -546,7 +546,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); importer.SetProgressChanged((description, step, steps) => { if (description.Contains("Inlezen vakindeling.")) @@ -571,7 +571,7 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); var messageProvider = mocks.StrictMock(); messageProvider.Expect(mp => mp.GetCancelledLogMessageText(sectionsTypeDescriptor)).Return(expectedCancelledText); @@ -584,7 +584,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); importer.SetProgressChanged((description, step, steps) => { if (description.Contains("Valideren ingelezen vakindeling.")) @@ -609,14 +609,11 @@ { // Setup var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); updateStrategy.Expect(us => us.UpdateSectionsWithImportedData(null, null)) .IgnoreArguments() - .WhenCalled(invocation => - { - CollectionAssert.IsNotEmpty((IEnumerable) invocation.Arguments[0]); - }) + .WhenCalled(invocation => { CollectionAssert.IsNotEmpty((IEnumerable) invocation.Arguments[0]); }) .Return(Enumerable.Empty()); var messageProvider = mocks.StrictMock(); @@ -630,7 +627,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); importer.SetProgressChanged((description, step, steps) => { if (description.Contains(expectedAddDataToModelProgressText)) @@ -662,7 +659,7 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); var mocks = new MockRepository(); - var failurePath = mocks.Stub(); + var failureMechanism = mocks.Stub(); var updateStrategy = mocks.StrictMock(); updateStrategy.Expect(us => us.UpdateSectionsWithImportedData(null, null)) .IgnoreArguments() @@ -678,7 +675,7 @@ var messageProvider = mocks.Stub(); mocks.ReplayAll(); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); importer.SetProgressChanged((description, step, steps) => importer.Cancel()); Assert.IsFalse(importer.Import()); @@ -730,8 +727,8 @@ ReferenceLine importReferenceLine = ImportReferenceLine(referenceLineFilePath); - var failurePath = new TestFailurePath(); - var importer = new FailureMechanismSectionsImporter(failurePath, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); + var failureMechanism = new TestFailureMechanism(); + var importer = new FailureMechanismSectionsImporter(failureMechanism, importReferenceLine, sectionsFilePath, updateStrategy, messageProvider); importer.Import(); updateSectionsWithImportedDataObservable.Attach(updateSectionsWithImportedDataObserver); Index: Riskeer/Common/test/Riskeer.Common.Plugin.TestUtil/ShouldCloseViewWithCalculationDataTester.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Plugin.TestUtil/ShouldCloseViewWithCalculationDataTester.cs (.../ShouldCloseViewWithCalculationDataTester.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Common/test/Riskeer.Common.Plugin.TestUtil/ShouldCloseViewWithCalculationDataTester.cs (.../ShouldCloseViewWithCalculationDataTester.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -44,7 +44,7 @@ public void ShouldCloseMethod_ViewCorrespondingToRemovedCalculationContext_ReturnsTrue() { // Setup - ICalculationContext calculationContext = GetCalculationContextWithCalculation(); + ICalculationContext calculationContext = GetCalculationContextWithCalculation(); using (IView view = GetView(calculationContext.WrappedData)) { @@ -60,7 +60,7 @@ public void ShouldCloseMethod_ViewNotCorrespondingToRemovedCalculationContext_ReturnsFalse() { // Setup - ICalculationContext calculationContext = GetCalculationContextWithCalculation(); + ICalculationContext calculationContext = GetCalculationContextWithCalculation(); using (IView view = GetView(GetCalculation())) { @@ -76,7 +76,7 @@ public void ShouldCloseMethod_ViewCorrespondingWithRemovedCalculationGroupContext_ReturnsTrue() { // Setup - ICalculationContext calculationGroupContext = GetCalculationGroupContextWithCalculation(); + ICalculationContext calculationGroupContext = GetCalculationGroupContextWithCalculation(); using (IView view = GetView(calculationGroupContext.WrappedData.GetCalculations().First())) { @@ -92,7 +92,7 @@ public void ShouldCloseMethod_ViewNotCorrespondingWithRemovedCalculationGroupContext_ReturnsFalse() { // Setup - ICalculationContext calculationGroupContext = GetCalculationGroupContextWithCalculation(); + ICalculationContext calculationGroupContext = GetCalculationGroupContextWithCalculation(); using (IView view = GetView(GetCalculation())) { @@ -123,7 +123,7 @@ public void ShouldCloseMethod_ViewNotCorrespondingWithRemovedFailureMechanism_ReturnsFalse() { // Setup - IFailureMechanism failureMechanism = GetFailureMechanismWithCalculation(); + ICalculatableFailureMechanism failureMechanism = GetFailureMechanismWithCalculation(); using (IView view = GetView(GetCalculation())) { // Call @@ -168,7 +168,7 @@ var mocks = new MockRepository(); var assessmentSection = mocks.Stub(); - IFailureMechanism failureMechanism = GetFailureMechanismWithCalculation(); + ICalculatableFailureMechanism failureMechanism = GetFailureMechanismWithCalculation(); assessmentSection.Stub(a => a.GetFailureMechanisms()).Return(new[] { failureMechanism @@ -218,7 +218,7 @@ /// /// A calculation context object. /// A default implementation is added for creating a . - protected virtual ICalculationContext GetCalculationContextWithCalculation() + protected virtual ICalculationContext GetCalculationContextWithCalculation() { return new TestCalculationContext(); } @@ -228,7 +228,7 @@ /// /// A calculation group context object. /// A default implementation is added for creating a . - protected virtual ICalculationContext GetCalculationGroupContextWithCalculation() + protected virtual ICalculationContext GetCalculationGroupContextWithCalculation() { return new TestCalculationGroupContext(); } @@ -239,29 +239,29 @@ /// A failure mechanism object. protected virtual ICalculatableFailureMechanism GetFailureMechanismWithCalculation() { - return new TestFailureMechanism(new[] + return new TestCalculatableFailureMechanism(new[] { new TestCalculation() }); } - private class TestCalculationContext : Observable, ICalculationContext + private class TestCalculationContext : Observable, ICalculationContext { public TestCalculationContext() { WrappedData = new TestCalculation("Calculation"); Parent = new CalculationGroup(); - FailureMechanism = new TestFailureMechanism(); + FailureMechanism = new TestCalculatableFailureMechanism(); } public TestCalculation WrappedData { get; } public CalculationGroup Parent { get; } - public TestFailureMechanism FailureMechanism { get; } + public TestCalculatableFailureMechanism FailureMechanism { get; } } - private class TestCalculationGroupContext : Observable, ICalculationContext + private class TestCalculationGroupContext : Observable, ICalculationContext { public TestCalculationGroupContext() { @@ -273,14 +273,14 @@ } }; Parent = new CalculationGroup(); - FailureMechanism = new TestFailureMechanism(); + FailureMechanism = new TestCalculatableFailureMechanism(); } public CalculationGroup WrappedData { get; } public CalculationGroup Parent { get; } - public TestFailureMechanism FailureMechanism { get; } + public TestCalculatableFailureMechanism FailureMechanism { get; } } } } \ No newline at end of file Index: Riskeer/Common/test/Riskeer.Common.Plugin.TestUtil/ShouldCloseViewWithFailurePathTester.cs =================================================================== diff -u -r74a4b453f00a27ed2dd4d0ef4aa9fc5ca762a35f -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Plugin.TestUtil/ShouldCloseViewWithFailurePathTester.cs (.../ShouldCloseViewWithFailurePathTester.cs) (revision 74a4b453f00a27ed2dd4d0ef4aa9fc5ca762a35f) +++ Riskeer/Common/test/Riskeer.Common.Plugin.TestUtil/ShouldCloseViewWithFailurePathTester.cs (.../ShouldCloseViewWithFailurePathTester.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -44,7 +44,7 @@ assessmentSection.Stub(asm => asm.SpecificFailurePaths).Return(new ObservableList()); mocks.ReplayAll(); - var failurePath = new TestFailurePath(); + var failurePath = new TestFailureMechanism(); using (IView view = GetView(failurePath)) { // Call @@ -61,7 +61,7 @@ public void ShouldCloseMethod_ViewCorrespondingToRemovedAssessmentSectionAndFailureMechanism_ReturnsTrue() { // Setup - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); var mocks = new MockRepository(); var assessmentSection = mocks.Stub(); @@ -88,7 +88,7 @@ public void ShouldCloseMethod_ViewNotCorrespondingToRemovedAssessmentSectionAndFailureMechanism_ReturnsFalse() { // Setup - var otherFailureMechanism = new TestFailureMechanism(); + var otherFailureMechanism = new TestCalculatableFailureMechanism(); var mocks = new MockRepository(); var failureMechanism = mocks.Stub(); @@ -116,7 +116,7 @@ public void ShouldCloseMethod_ViewCorrespondingToRemovedFailureMechanism_ReturnsTrue() { // Setup - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); using (IView view = GetView(failureMechanism)) { @@ -132,7 +132,7 @@ public void ShouldCloseMethod_ViewNotCorrespondingToRemovedFailureMechanism_ReturnsFalse() { // Setup - var otherFailureMechanism = new TestFailureMechanism(); + var otherFailureMechanism = new TestCalculatableFailureMechanism(); var mocks = new MockRepository(); var failureMechanism = mocks.Stub(); @@ -185,7 +185,7 @@ var otherFailurePath = mocks.Stub(); mocks.ReplayAll(); - var failurePath = new TestFailurePath(); + var failurePath = new TestFailureMechanism(); using (IView view = GetView(failurePath)) { // Call @@ -202,7 +202,7 @@ public void ShouldCloseMethod_ViewCorrespondingToRemovedFailurePath_ReturnsTrue() { // Setup - var failurePath = new TestFailurePath(); + var failurePath = new TestFailureMechanism(); using (IView view = GetView(failurePath)) { @@ -223,7 +223,7 @@ var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - var failurePath = new TestFailurePath(); + var failurePath = new TestFailureMechanism(); var failurePathContext = new TestFailureMechanismContext(otherFailurePath, assessmentSection); using (IView view = GetView(failurePath)) @@ -246,7 +246,7 @@ var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - var failurePath = new TestFailurePath(); + var failurePath = new TestFailureMechanism(); var failurePathContext = new TestFailureMechanismContext(failurePath, assessmentSection); using (IView view = GetView(failurePath)) Index: Riskeer/Common/test/Riskeer.Common.Service.Test/Structures/StructuresCalculationServiceBaseTest.cs =================================================================== diff -u -r96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Common/test/Riskeer.Common.Service.Test/Structures/StructuresCalculationServiceBaseTest.cs (.../StructuresCalculationServiceBaseTest.cs) (revision 96ccefa48aa5c97c949f7a7858fcb4d3dc727a3a) +++ Riskeer/Common/test/Riskeer.Common.Service.Test/Structures/StructuresCalculationServiceBaseTest.cs (.../StructuresCalculationServiceBaseTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -98,7 +98,7 @@ { // Setup var mocks = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(new TestFailureMechanism(), + IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(new TestCalculatableFailureMechanism(), mocks, Path.Combine(testDataPath, "notexisting.sqlite")); mocks.ReplayAll(); @@ -132,7 +132,7 @@ var mocks = new MockRepository(); IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub( - new TestFailureMechanism(), mocks, validHydraulicBoundaryDatabaseFilePath); + new TestCalculatableFailureMechanism(), mocks, validHydraulicBoundaryDatabaseFilePath); assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.CanUsePreprocessor = true; assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.UsePreprocessor = true; @@ -166,7 +166,7 @@ { // Setup var mocks = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(new TestFailureMechanism(), + IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(new TestCalculatableFailureMechanism(), mocks, Path.Combine(testDataPath, "HRD nosettings.sqlite")); mocks.ReplayAll(); @@ -198,7 +198,7 @@ { // Setup var mocks = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(new TestFailureMechanism(), + IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(new TestCalculatableFailureMechanism(), mocks); mocks.ReplayAll(); @@ -226,7 +226,7 @@ { // Setup var mocks = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(new TestFailureMechanism(), + IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(new TestCalculatableFailureMechanism(), mocks, validHydraulicBoundaryDatabaseFilePath); mocks.ReplayAll(); @@ -262,7 +262,7 @@ public void Validate_CalculationWithoutStructuresValidHydraulicBoundaryDatabase_LogsErrorAndReturnsFalse() { // Setup - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); var mocks = new MockRepository(); IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub( @@ -300,7 +300,7 @@ public void Validate_InputInvalidAccordingToValidationRule_LogErrorAndReturnFalse() { // Setup - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); var mocks = new MockRepository(); IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub( @@ -340,7 +340,7 @@ public void Validate_ValidInputWithCanUseProcessorFalse_ReturnsTrue() { // Setup - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); var mocks = new MockRepository(); IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub( @@ -382,7 +382,7 @@ var mocks = new MockRepository(); IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub( - new TestFailureMechanism(), mocks, validHydraulicBoundaryDatabaseFilePath); + new TestCalculatableFailureMechanism(), mocks, validHydraulicBoundaryDatabaseFilePath); assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.CanUsePreprocessor = true; assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.UsePreprocessor = false; @@ -425,7 +425,7 @@ var mocks = new MockRepository(); IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub( - new TestFailureMechanism(), mocks, validHydraulicBoundaryDatabaseFilePath); + new TestCalculatableFailureMechanism(), mocks, validHydraulicBoundaryDatabaseFilePath); assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.CanUsePreprocessor = true; assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.UsePreprocessor = true; Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsOutputViewInfoTestBase.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsOutputViewInfoTestBase.cs (.../GrassCoverErosionInwardsOutputViewInfoTestBase.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsOutputViewInfoTestBase.cs (.../GrassCoverErosionInwardsOutputViewInfoTestBase.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -127,15 +127,15 @@ return new GrassCoverErosionInwardsCalculation(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new GrassCoverErosionInwardsCalculationScenarioContext(new GrassCoverErosionInwardsCalculationScenario(), new CalculationGroup(), new GrassCoverErosionInwardsFailureMechanism(), new AssessmentSectionStub()); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new GrassCoverErosionInwardsCalculationGroupContext( new CalculationGroup Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsWaveConditionsInputViewInfoTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsWaveConditionsInputViewInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsInputViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsWaveConditionsInputViewInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsInputViewInfoTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -172,7 +172,7 @@ return new GrassCoverErosionOutwardsWaveConditionsCalculation(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new GrassCoverErosionOutwardsWaveConditionsCalculationContext( new GrassCoverErosionOutwardsWaveConditionsCalculation(), @@ -181,7 +181,7 @@ new AssessmentSectionStub()); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new GrassCoverErosionOutwardsCalculationGroupContext( new CalculationGroup Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/FileImporters/ForeshoreProfileReplaceDataStrategyTest.cs =================================================================== diff -u -r51d6a6c0fed071e9ad51f8cbc65e7449b1e928ca -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/FileImporters/ForeshoreProfileReplaceDataStrategyTest.cs (.../ForeshoreProfileReplaceDataStrategyTest.cs) (revision 51d6a6c0fed071e9ad51f8cbc65e7449b1e928ca) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/FileImporters/ForeshoreProfileReplaceDataStrategyTest.cs (.../ForeshoreProfileReplaceDataStrategyTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -54,7 +54,7 @@ public void Constructor_ForeshoreProfileCollectionNull_ThrowsArgumentNullException() { // Call - void Call() => new ForeshoreProfileReplaceDataStrategy(new TestFailureMechanism(), null); + void Call() => new ForeshoreProfileReplaceDataStrategy(new TestCalculatableFailureMechanism(), null); // Assert var exception = Assert.Throws(Call); @@ -65,7 +65,7 @@ public void Constructor_SupportedFailureMechanism_CreatesNewInstance() { // Call - var strategy = new ForeshoreProfileReplaceDataStrategy(new TestFailureMechanism(), new ForeshoreProfileCollection()); + var strategy = new ForeshoreProfileReplaceDataStrategy(new TestCalculatableFailureMechanism(), new ForeshoreProfileCollection()); // Assert Assert.IsInstanceOf>(strategy); @@ -77,7 +77,7 @@ { // Setup var foreshoreProfileCollection = new ForeshoreProfileCollection(); - var strategy = new ForeshoreProfileReplaceDataStrategy(new TestFailureMechanism(), foreshoreProfileCollection); + var strategy = new ForeshoreProfileReplaceDataStrategy(new TestCalculatableFailureMechanism(), foreshoreProfileCollection); // Call void Call() => strategy.UpdateForeshoreProfilesWithImportedData(null, "path"); @@ -92,7 +92,7 @@ { // Setup var foreshoreProfileCollection = new ForeshoreProfileCollection(); - var strategy = new ForeshoreProfileReplaceDataStrategy(new TestFailureMechanism(), foreshoreProfileCollection); + var strategy = new ForeshoreProfileReplaceDataStrategy(new TestCalculatableFailureMechanism(), foreshoreProfileCollection); // Call void Call() => strategy.UpdateForeshoreProfilesWithImportedData(Enumerable.Empty(), null); @@ -107,7 +107,7 @@ { // Setup var foreshoreProfiles = new ForeshoreProfileCollection(); - var strategy = new ForeshoreProfileReplaceDataStrategy(new TestFailureMechanism(), foreshoreProfiles); + var strategy = new ForeshoreProfileReplaceDataStrategy(new TestCalculatableFailureMechanism(), foreshoreProfiles); const string duplicateId = "Just a duplicate ID"; var importedForeshoreProfiles = new[] @@ -130,7 +130,7 @@ { // Setup var foreshoreProfiles = new ForeshoreProfileCollection(); - var strategy = new ForeshoreProfileReplaceDataStrategy(new TestFailureMechanism(), foreshoreProfiles); + var strategy = new ForeshoreProfileReplaceDataStrategy(new TestCalculatableFailureMechanism(), foreshoreProfiles); const string newForeshoreProfilesPath = "new/path"; @@ -151,7 +151,7 @@ { // Setup var foreshoreProfiles = new ForeshoreProfileCollection(); - var strategy = new ForeshoreProfileReplaceDataStrategy(new TestFailureMechanism(), foreshoreProfiles); + var strategy = new ForeshoreProfileReplaceDataStrategy(new TestCalculatableFailureMechanism(), foreshoreProfiles); var importedForeshoreProfiles = new[] { @@ -180,7 +180,7 @@ new TestForeshoreProfile("Profile 1", "ID 1") }, sourceFilePath); - var strategy = new ForeshoreProfileReplaceDataStrategy(new TestFailureMechanism(), foreshoreProfiles); + var strategy = new ForeshoreProfileReplaceDataStrategy(new TestCalculatableFailureMechanism(), foreshoreProfiles); var importedForeshoreProfiles = new[] { @@ -211,7 +211,7 @@ TestCalculationWithForeshoreProfile calculationWithoutForeshoreProfile = TestCalculationWithForeshoreProfile.CreateDefaultCalculation(); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculationWithForeshoreProfileAndOutput, calculationWithForeshoreProfile, Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/FileImporters/ForeshoreProfileUpdateDataStrategyTest.cs =================================================================== diff -u -r51d6a6c0fed071e9ad51f8cbc65e7449b1e928ca -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/FileImporters/ForeshoreProfileUpdateDataStrategyTest.cs (.../ForeshoreProfileUpdateDataStrategyTest.cs) (revision 51d6a6c0fed071e9ad51f8cbc65e7449b1e928ca) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/FileImporters/ForeshoreProfileUpdateDataStrategyTest.cs (.../ForeshoreProfileUpdateDataStrategyTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -108,7 +108,7 @@ public void Constructor_ForeshoreProfilesNull_ThrowsArgumentNullException() { // Call - void Call() => new ForeshoreProfileUpdateDataStrategy(new TestFailureMechanism(), null); + void Call() => new ForeshoreProfileUpdateDataStrategy(new TestCalculatableFailureMechanism(), null); // Assert var exception = Assert.Throws(Call); @@ -119,7 +119,7 @@ public void Constructor_CreatesNewInstance() { // Call - var strategy = new ForeshoreProfileUpdateDataStrategy(new TestFailureMechanism(), new ForeshoreProfileCollection()); + var strategy = new ForeshoreProfileUpdateDataStrategy(new TestCalculatableFailureMechanism(), new ForeshoreProfileCollection()); // Assert Assert.IsInstanceOf(strategy); @@ -130,7 +130,7 @@ public void UpdateForeshoreProfilesWithImportedData_ImportedDataCollectionNull_ThrowsArgumentNullException() { // Setup - var strategy = new ForeshoreProfileUpdateDataStrategy(new TestFailureMechanism(), new ForeshoreProfileCollection()); + var strategy = new ForeshoreProfileUpdateDataStrategy(new TestCalculatableFailureMechanism(), new ForeshoreProfileCollection()); // Call void Call() => strategy.UpdateForeshoreProfilesWithImportedData(null, sourceFilePath); @@ -144,7 +144,7 @@ public void UpdateForeshoreProfilesWithImportedData_SourceFilePathNull_ThrowsArgumentNullException() { // Setup - var strategy = new ForeshoreProfileUpdateDataStrategy(new TestFailureMechanism(), new ForeshoreProfileCollection()); + var strategy = new ForeshoreProfileUpdateDataStrategy(new TestCalculatableFailureMechanism(), new ForeshoreProfileCollection()); // Call void Call() => strategy.UpdateForeshoreProfilesWithImportedData(Enumerable.Empty(), null); @@ -168,7 +168,7 @@ profileToBeUpdated }, sourceFilePath); - var strategy = new ForeshoreProfileUpdateDataStrategy(new TestFailureMechanism(), targetCollection); + var strategy = new ForeshoreProfileUpdateDataStrategy(new TestCalculatableFailureMechanism(), targetCollection); // Call strategy.UpdateForeshoreProfilesWithImportedData(new[] @@ -195,7 +195,7 @@ new TestForeshoreProfile("Name B", duplicateId) }; - var strategy = new ForeshoreProfileUpdateDataStrategy(new TestFailureMechanism(), foreshoreProfiles); + var strategy = new ForeshoreProfileUpdateDataStrategy(new TestCalculatableFailureMechanism(), foreshoreProfiles); // Call void Call() => strategy.UpdateForeshoreProfilesWithImportedData(importedForeshoreProfiles, sourceFilePath); @@ -227,7 +227,7 @@ new TestForeshoreProfile("Name B", duplicateId) }; - var strategy = new ForeshoreProfileUpdateDataStrategy(new TestFailureMechanism(), foreshoreProfiles); + var strategy = new ForeshoreProfileUpdateDataStrategy(new TestCalculatableFailureMechanism(), foreshoreProfiles); // Call void Call() => strategy.UpdateForeshoreProfilesWithImportedData(importedForeshoreProfiles, sourceFilePath); @@ -260,7 +260,7 @@ targetForeshoreProfile }, sourceFilePath); - var strategy = new ForeshoreProfileUpdateDataStrategy(new TestFailureMechanism(), foreshoreProfiles); + var strategy = new ForeshoreProfileUpdateDataStrategy(new TestCalculatableFailureMechanism(), foreshoreProfiles); // Call IEnumerable affectedObjects = @@ -295,7 +295,7 @@ readForeshoreProfile }; - var strategy = new ForeshoreProfileUpdateDataStrategy(new TestFailureMechanism(), foreshoreProfiles); + var strategy = new ForeshoreProfileUpdateDataStrategy(new TestCalculatableFailureMechanism(), foreshoreProfiles); // Call IEnumerable affectedObjects = strategy.UpdateForeshoreProfilesWithImportedData(importedForeshoreProfiles, @@ -336,7 +336,7 @@ foreshoreProfileToBeAdded }; - var strategy = new ForeshoreProfileUpdateDataStrategy(new TestFailureMechanism(), foreshoreProfiles); + var strategy = new ForeshoreProfileUpdateDataStrategy(new TestCalculatableFailureMechanism(), foreshoreProfiles); // Call IEnumerable affectedObjects = strategy.UpdateForeshoreProfilesWithImportedData(importedForeshoreProfiles, @@ -378,7 +378,7 @@ profileToBeRemoved }, sourceFilePath); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { calculation }); @@ -426,7 +426,7 @@ }; foreshoreProfiles.AddRange(originalForeshoreProfiles, sourceFilePath); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { affectedCalculation, unaffectedCalculation @@ -481,7 +481,7 @@ }; foreshoreProfiles.AddRange(originalForeshoreProfiles, sourceFilePath); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { affectedCalculation, calculationSameReference @@ -532,7 +532,7 @@ }; foreshoreProfiles.AddRange(originalForeshoreProfiles, sourceFilePath); - var failureMechanism = new TestFailureMechanism(new[] + var failureMechanism = new TestCalculatableFailureMechanism(new[] { affectedCalculation }); Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/FailureMechanismSectionsViewInfoTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/FailureMechanismSectionsViewInfoTest.cs (.../FailureMechanismSectionsViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/FailureMechanismSectionsViewInfoTest.cs (.../FailureMechanismSectionsViewInfoTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -74,14 +74,14 @@ var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - var failurePath = new TestFailurePath(); - var failureMechanismSectionsContext = new FailureMechanismSectionsContext(failurePath, assessmentSection); + var failureMechanism = new TestFailureMechanism(); + var failureMechanismSectionsContext = new FailureMechanismSectionsContext(failureMechanism, assessmentSection); // Call object viewData = info.GetViewData(failureMechanismSectionsContext); // Assert - Assert.AreSame(failurePath.Sections, viewData); + Assert.AreSame(failureMechanism.Sections, viewData); mocks.VerifyAll(); } Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/GeneralResultFaultTreeIllustrationPointViewInfoTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/GeneralResultFaultTreeIllustrationPointViewInfoTest.cs (.../GeneralResultFaultTreeIllustrationPointViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/GeneralResultFaultTreeIllustrationPointViewInfoTest.cs (.../GeneralResultFaultTreeIllustrationPointViewInfoTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -140,7 +140,7 @@ return new StructuresCalculation(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new HeightStructuresCalculationScenarioContext( new StructuresCalculationScenario(), @@ -149,7 +149,7 @@ new AssessmentSection(AssessmentSectionComposition.Dike)); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new HeightStructuresCalculationGroupContext( new CalculationGroup @@ -187,7 +187,7 @@ return new StructuresCalculation(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new ClosingStructuresCalculationScenarioContext( new StructuresCalculationScenario(), @@ -196,7 +196,7 @@ new AssessmentSection(AssessmentSectionComposition.Dike)); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new ClosingStructuresCalculationGroupContext( new CalculationGroup @@ -235,7 +235,7 @@ return new StructuresCalculation(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new StabilityPointStructuresCalculationScenarioContext( new StructuresCalculationScenario(), @@ -244,7 +244,7 @@ new AssessmentSection(AssessmentSectionComposition.Dike)); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new StabilityPointStructuresCalculationGroupContext( new CalculationGroup Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsOutputViewInfoTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsOutputViewInfoTest.cs (.../MacroStabilityInwardsOutputViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsOutputViewInfoTest.cs (.../MacroStabilityInwardsOutputViewInfoTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -138,7 +138,7 @@ return new MacroStabilityInwardsCalculationScenario(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new MacroStabilityInwardsCalculationScenarioContext( new MacroStabilityInwardsCalculationScenario(), @@ -149,7 +149,7 @@ new AssessmentSectionStub()); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new MacroStabilityInwardsCalculationGroupContext( new CalculationGroup Index: Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticFaultTreePipingProfileSpecificOutputViewInfoTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticFaultTreePipingProfileSpecificOutputViewInfoTest.cs (.../ProbabilisticFaultTreePipingProfileSpecificOutputViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticFaultTreePipingProfileSpecificOutputViewInfoTest.cs (.../ProbabilisticFaultTreePipingProfileSpecificOutputViewInfoTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -182,7 +182,7 @@ return new ProbabilisticPipingCalculationScenario(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new ProbabilisticPipingCalculationScenarioContext( new ProbabilisticPipingCalculationScenario(), @@ -193,7 +193,7 @@ new AssessmentSectionStub()); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new PipingCalculationGroupContext( new CalculationGroup Index: Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticFaultTreePipingSectionSpecificOutputViewInfoTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticFaultTreePipingSectionSpecificOutputViewInfoTest.cs (.../ProbabilisticFaultTreePipingSectionSpecificOutputViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticFaultTreePipingSectionSpecificOutputViewInfoTest.cs (.../ProbabilisticFaultTreePipingSectionSpecificOutputViewInfoTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -183,7 +183,7 @@ return new ProbabilisticPipingCalculationScenario(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new ProbabilisticPipingCalculationScenarioContext( new ProbabilisticPipingCalculationScenario(), @@ -194,7 +194,7 @@ new AssessmentSectionStub()); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new PipingCalculationGroupContext( new CalculationGroup Index: Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticSubMechanismPipingProfileSpecificOutputViewInfoTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticSubMechanismPipingProfileSpecificOutputViewInfoTest.cs (.../ProbabilisticSubMechanismPipingProfileSpecificOutputViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticSubMechanismPipingProfileSpecificOutputViewInfoTest.cs (.../ProbabilisticSubMechanismPipingProfileSpecificOutputViewInfoTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -182,7 +182,7 @@ return new ProbabilisticPipingCalculationScenario(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new ProbabilisticPipingCalculationScenarioContext( new ProbabilisticPipingCalculationScenario(), @@ -193,7 +193,7 @@ new AssessmentSectionStub()); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new PipingCalculationGroupContext( new CalculationGroup Index: Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticSubMechanismPipingSectionSpecificOutputViewInfoTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticSubMechanismPipingSectionSpecificOutputViewInfoTest.cs (.../ProbabilisticSubMechanismPipingSectionSpecificOutputViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/ViewInfos/ProbabilisticSubMechanismPipingSectionSpecificOutputViewInfoTest.cs (.../ProbabilisticSubMechanismPipingSectionSpecificOutputViewInfoTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -183,7 +183,7 @@ return new ProbabilisticPipingCalculationScenario(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new ProbabilisticPipingCalculationScenarioContext( new ProbabilisticPipingCalculationScenario(), @@ -194,7 +194,7 @@ new AssessmentSectionStub()); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new PipingCalculationGroupContext( new CalculationGroup Index: Riskeer/Revetment/test/Riskeer.Revetment.Service.Test/WaveConditionsDataSynchronizationServiceTest.cs =================================================================== diff -u -r21ded87c36d9ef4309ae4b85dc60b67358b1e1c2 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Revetment/test/Riskeer.Revetment.Service.Test/WaveConditionsDataSynchronizationServiceTest.cs (.../WaveConditionsDataSynchronizationServiceTest.cs) (revision 21ded87c36d9ef4309ae4b85dc60b67358b1e1c2) +++ Riskeer/Revetment/test/Riskeer.Revetment.Service.Test/WaveConditionsDataSynchronizationServiceTest.cs (.../WaveConditionsDataSynchronizationServiceTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -60,7 +60,7 @@ // Call void Call() => WaveConditionsDataSynchronizationService.ClearAllWaveConditionsCalculationOutput>( - new TestFailureMechanism(), normType); + new TestCalculatableFailureMechanism(), normType); // Assert var expectedMessage = $"The value of argument 'normType' ({normType}) is invalid for Enum type '{nameof(NormType)}'."; @@ -137,7 +137,7 @@ { // Call void Call() => WaveConditionsDataSynchronizationService.ClearAllWaveConditionsCalculationOutput>( - new TestFailureMechanism(), null); + new TestCalculatableFailureMechanism(), null); // Assert var exception = Assert.Throws(Call); @@ -222,7 +222,7 @@ { // Call void Call() => WaveConditionsDataSynchronizationService.ClearWaveConditionsCalculationOutputAndRemoveTargetProbability>( - new TestFailureMechanism(), null); + new TestCalculatableFailureMechanism(), null); // Assert var exception = Assert.Throws(Call); Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverWaveConditionsInputViewInfoTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverWaveConditionsInputViewInfoTest.cs (.../StabilityStoneCoverWaveConditionsInputViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverWaveConditionsInputViewInfoTest.cs (.../StabilityStoneCoverWaveConditionsInputViewInfoTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -172,7 +172,7 @@ return new StabilityStoneCoverWaveConditionsCalculation(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new StabilityStoneCoverWaveConditionsCalculationContext( new StabilityStoneCoverWaveConditionsCalculation(), @@ -181,7 +181,7 @@ new AssessmentSectionStub()); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new StabilityStoneCoverCalculationGroupContext( new CalculationGroup Index: Riskeer/Storage/test/Riskeer.Storage.Core.Test/Create/FailurePathCreateExtensionsTest.cs =================================================================== diff -u -rba639d608bbfcd02a294acfa6c428d41f2e627ce -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Storage/test/Riskeer.Storage.Core.Test/Create/FailurePathCreateExtensionsTest.cs (.../FailurePathCreateExtensionsTest.cs) (revision ba639d608bbfcd02a294acfa6c428d41f2e627ce) +++ Riskeer/Storage/test/Riskeer.Storage.Core.Test/Create/FailurePathCreateExtensionsTest.cs (.../FailurePathCreateExtensionsTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -153,7 +153,7 @@ // Setup var random = new Random(21); var failureMechanismType = random.NextEnumValue(); - IFailureMechanism failureMechanism = new TestFailureMechanism("a", "cool") + IFailureMechanism failureMechanism = new TestCalculatableFailureMechanism("a", "cool") { InAssemblyInputComments = { @@ -310,7 +310,7 @@ // Setup var random = new Random(21); var failureMechanismType = random.NextEnumValue(); - var failureMechanism = new TestFailureMechanism("a", "cool") + var failureMechanism = new TestCalculatableFailureMechanism("a", "cool") { InAssemblyInputComments = { Index: Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/FailurePathEntityReadExtensionsTest.cs =================================================================== diff -u -rba639d608bbfcd02a294acfa6c428d41f2e627ce -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/FailurePathEntityReadExtensionsTest.cs (.../FailurePathEntityReadExtensionsTest.cs) (revision ba639d608bbfcd02a294acfa6c428d41f2e627ce) +++ Riskeer/Storage/test/Riskeer.Storage.Core.Test/Read/FailurePathEntityReadExtensionsTest.cs (.../FailurePathEntityReadExtensionsTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -108,7 +108,7 @@ ManualFailurePathAssemblyProbability = random.NextDouble() }; var collector = new ReadConversionCollector(); - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); // Call entity.ReadCommonFailurePathProperties(failureMechanism, collector); @@ -126,7 +126,7 @@ // Setup var entity = new FailureMechanismEntity(); var collector = new ReadConversionCollector(); - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); // Call entity.ReadCommonFailurePathProperties(failureMechanism, collector); @@ -236,7 +236,7 @@ ManualFailurePathAssemblyProbability = random.NextDouble() }; var collector = new ReadConversionCollector(); - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); // Call entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); @@ -254,7 +254,7 @@ // Setup var entity = new FailureMechanismEntity(); var collector = new ReadConversionCollector(); - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); // Call entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); @@ -284,7 +284,7 @@ } }; var collector = new ReadConversionCollector(); - var failureMechanism = new TestFailureMechanism(); + var failureMechanism = new TestCalculatableFailureMechanism(); // Call entity.ReadCommonFailureMechanismProperties(failureMechanism, collector); Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs =================================================================== diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -re52a2b934228724b12e794fc38b91c69400bfabc --- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782) +++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs) (revision e52a2b934228724b12e794fc38b91c69400bfabc) @@ -172,7 +172,7 @@ return new WaveImpactAsphaltCoverWaveConditionsCalculation(); } - protected override ICalculationContext GetCalculationContextWithCalculation() + protected override ICalculationContext GetCalculationContextWithCalculation() { return new WaveImpactAsphaltCoverWaveConditionsCalculationContext( new WaveImpactAsphaltCoverWaveConditionsCalculation(), @@ -181,7 +181,7 @@ new AssessmentSectionStub()); } - protected override ICalculationContext GetCalculationGroupContextWithCalculation() + protected override ICalculationContext GetCalculationGroupContextWithCalculation() { return new WaveImpactAsphaltCoverCalculationGroupContext( new CalculationGroup