Index: Riskeer/AssemblyTool/src/Riskeer.AssemblyTool.KernelWrapper/Calculators/Assembly/FailureMechanismAssemblyCalculator.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/AssemblyTool/src/Riskeer.AssemblyTool.KernelWrapper/Calculators/Assembly/FailureMechanismAssemblyCalculator.cs (.../FailureMechanismAssemblyCalculator.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/AssemblyTool/src/Riskeer.AssemblyTool.KernelWrapper/Calculators/Assembly/FailureMechanismAssemblyCalculator.cs (.../FailureMechanismAssemblyCalculator.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -64,10 +64,9 @@ try { IFailureMechanismResultAssembler kernel = factory.CreateFailureMechanismAssemblyKernel(); - Probability result; - result = kernel.CalculateFailureMechanismFailureProbabilityBoi1A1( - sectionAssemblyResults.Select(sr => AssemblyCalculatorInputCreator.CreateProbability(sr.SectionProbability)).ToArray() - , false); + Probability result = kernel.CalculateFailureMechanismFailureProbabilityBoi1A1( + sectionAssemblyResults.Select(sr => AssemblyCalculatorInputCreator.CreateProbability(sr.SectionProbability)).ToArray(), + false); return new FailureMechanismAssemblyResultWrapper(result, AssemblyMethod.BOI1A1); } catch (AssemblyException e) @@ -92,21 +91,14 @@ { IFailureMechanismResultAssembler kernel = factory.CreateFailureMechanismAssemblyKernel(); - Probability result; + Func probabilityFunc = applySectionLengthEffect + ? (Func) (sr => sr.ProfileProbability) + : sr => sr.SectionProbability; - if (applySectionLengthEffect) - { - result = kernel.CalculateFailureMechanismFailureProbabilityBoi1A2( - sectionAssemblyResults.Select(sr => AssemblyCalculatorInputCreator.CreateProbability(sr.ProfileProbability)).ToArray(), - failureMechanismN, - false); - return new FailureMechanismAssemblyResultWrapper(result, AssemblyMethod.BOI1A2); - } + Probability result = kernel.CalculateFailureMechanismFailureProbabilityBoi1A2( + sectionAssemblyResults.Select(sr => AssemblyCalculatorInputCreator.CreateProbability(probabilityFunc(sr))).ToArray(), + failureMechanismN, false); - result = kernel.CalculateFailureMechanismFailureProbabilityBoi1A2( - sectionAssemblyResults.Select(sr => AssemblyCalculatorInputCreator.CreateProbability(sr.SectionProbability)).ToArray(), - failureMechanismN, - false); return new FailureMechanismAssemblyResultWrapper(result, AssemblyMethod.BOI1A2); } catch (AssemblyException e) Index: Riskeer/AssemblyTool/test/Riskeer.AssemblyTool.KernelWrapper.Test/Calculators/Assembly/FailureMechanismAssemblyCalculatorTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/AssemblyTool/test/Riskeer.AssemblyTool.KernelWrapper.Test/Calculators/Assembly/FailureMechanismAssemblyCalculatorTest.cs (.../FailureMechanismAssemblyCalculatorTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/AssemblyTool/test/Riskeer.AssemblyTool.KernelWrapper.Test/Calculators/Assembly/FailureMechanismAssemblyCalculatorTest.cs (.../FailureMechanismAssemblyCalculatorTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -67,6 +67,16 @@ mocks.VerifyAll(); } + private static RiskeerFailureMechanismSectionAssemblyResult CreateSectionAssemblyResult(int seed) + { + var random = new Random(seed); + double probability = random.NextDouble(); + return new RiskeerFailureMechanismSectionAssemblyResult(probability, probability + 0.001, random.NextDouble(), + random.NextEnumValue()); + } + + # region without sectionLengthEffect + [Test] public void Assemble_SectionAssemblyResultsNull_ThrowsArgumentNullException() { @@ -89,11 +99,10 @@ } [Test] - public void Assemble_WithValidInputAndApplyLengthEffectTrue_SendsCorrectInputToKernel() + public void Assemble_WithValidInput_SendsCorrectInputToKernel() { // Setup var random = new Random(21); - double failureMechanismN = random.NextDouble(); RiskeerFailureMechanismSectionAssemblyResult[] sectionAssemblyResults = { CreateSectionAssemblyResult(random.Next()), @@ -109,115 +118,166 @@ var calculator = new FailureMechanismAssemblyCalculator(factory); // Call - calculator.Assemble(failureMechanismN, sectionAssemblyResults, true); + calculator.Assemble(sectionAssemblyResults); // Assert - Assert.AreEqual(failureMechanismN, kernel.LenghtEffectFactor); + Assert.AreEqual(0, kernel.LenghtEffectFactor); Assert.IsFalse(kernel.PartialAssembly); - Assert.AreEqual(sectionAssemblyResults.Length, kernel.FailureMechanismSectionAssemblyResults.Count()); - for (var i = 0; i < sectionAssemblyResults.Length; i++) - { - RiskeerFailureMechanismSectionAssemblyResult expected = sectionAssemblyResults.ElementAt(i); - Probability actual = kernel.FailureMechanismSectionAssemblyResults.ElementAt(i); - ProbabilityAssert.AreEqual(expected.ProfileProbability, actual); - } + + CollectionAssert.AreEqual(sectionAssemblyResults.Select(r => new Probability(r.SectionProbability)), kernel.FailureMechanismSectionProbabilities); } } [Test] - public void Assemble_WithValidInputAndApplyLengthEffectFalseP2_SendsCorrectInputToKernel() + public void Assemble_WithValidOutput_ReturnsExpectedOutput() { // Setup var random = new Random(21); - double failureMechanismN = random.NextDouble(); - RiskeerFailureMechanismSectionAssemblyResult[] sectionAssemblyResults = - { - CreateSectionAssemblyResult(random.Next()), - CreateSectionAssemblyResult(random.Next()) - }; using (new AssemblyToolKernelFactoryConfig()) { var factory = (TestAssemblyToolKernelFactory) AssemblyToolKernelFactory.Instance; FailureMechanismAssemblyKernelStub kernel = factory.LastCreatedFailureMechanismAssemblyKernel; - kernel.ProbabilityResult = new Probability(random.NextDouble()); + var output = new Probability(random.NextDouble()); + kernel.ProbabilityResult = output; var calculator = new FailureMechanismAssemblyCalculator(factory); // Call - calculator.Assemble(failureMechanismN, sectionAssemblyResults, false); + FailureMechanismAssemblyResultWrapper assemblyResultWrapper = calculator.Assemble(Enumerable.Empty()); // Assert - Assert.AreEqual(failureMechanismN, kernel.LenghtEffectFactor); - Assert.IsFalse(kernel.PartialAssembly); - Assert.AreEqual(sectionAssemblyResults.Length, kernel.FailureMechanismSectionAssemblyResults.Count()); - for (var i = 0; i < sectionAssemblyResults.Length; i++) - { - RiskeerFailureMechanismSectionAssemblyResult expected = sectionAssemblyResults.ElementAt(i); - Probability actual = kernel.FailureMechanismSectionAssemblyResults.ElementAt(i); - ProbabilityAssert.AreEqual(expected.SectionProbability, actual); - } + Assert.IsTrue(kernel.Calculated); + ProbabilityAssert.AreEqual(assemblyResultWrapper.AssemblyResult, output); + Assert.AreEqual(assemblyResultWrapper.AssemblyMethod, AssemblyMethod.BOI1A1); } } - + [Test] - public void Assemble_WithValidInputAndApplyLengthEffectFalseP1_SendsCorrectInputToKernel() + public void Assemble_KernelThrowsException_ThrowsFailureMechanismAssemblyCalculatorException() { // Setup var random = new Random(21); - double failureMechanismN = random.NextDouble(); - RiskeerFailureMechanismSectionAssemblyResult[] sectionAssemblyResults = + + using (new AssemblyToolKernelFactoryConfig()) { - CreateSectionAssemblyResult(random.Next()), - CreateSectionAssemblyResult(random.Next()) - }; + var factory = (TestAssemblyToolKernelFactory) AssemblyToolKernelFactory.Instance; + FailureMechanismAssemblyKernelStub kernel = factory.LastCreatedFailureMechanismAssemblyKernel; + kernel.ThrowExceptionOnCalculate = true; + var calculator = new FailureMechanismAssemblyCalculator(factory); + + // Call + void Call() => calculator.Assemble(Enumerable.Empty()); + + // Assert + + var exception = Assert.Throws(Call); + Assert.IsFalse(kernel.Calculated); + Assert.IsInstanceOf(exception.InnerException); + Assert.AreEqual(AssemblyErrorMessageCreator.CreateGenericErrorMessage(), exception.Message); + } + } + + [Test] + public void Assemble_KernelThrowsAssemblyException_ThrowsFailureMechanismAssemblyCalculatorException() + { + // Setup + var random = new Random(21); + using (new AssemblyToolKernelFactoryConfig()) { var factory = (TestAssemblyToolKernelFactory) AssemblyToolKernelFactory.Instance; FailureMechanismAssemblyKernelStub kernel = factory.LastCreatedFailureMechanismAssemblyKernel; - kernel.ProbabilityResult = new Probability(random.NextDouble()); + kernel.ThrowAssemblyExceptionOnCalculate = true; var calculator = new FailureMechanismAssemblyCalculator(factory); // Call - calculator.Assemble(sectionAssemblyResults); + void Call() => calculator.Assemble(Enumerable.Empty()); // Assert - Assert.AreEqual(0, kernel.LenghtEffectFactor); - Assert.IsFalse(kernel.PartialAssembly); - CollectionAssert.AreEqual(sectionAssemblyResults.Select(r => new Probability(r.SectionProbability)), kernel.FailureMechanismSectionProbabilities); + var exception = Assert.Throws(Call); + var innerException = exception.InnerException as AssemblyException; + Assert.IsFalse(kernel.Calculated); + Assert.IsNotNull(innerException); + Assert.AreEqual(AssemblyErrorMessageCreator.CreateErrorMessage(innerException.Errors), exception.Message); } } + # endregion + + #region with sectionLengthEffect + [Test] - public void Assemble_WithValidOutput_ReturnsExpectedOutput() + public void AssembleWithFailureMechanismNAndApplyLengthEffect_SectionAssemblyResultsNull_ThrowsArgumentNullException() { // Setup + var mocks = new MockRepository(); + var kernelFactory = mocks.Stub(); + mocks.ReplayAll(); + + var calculator = new FailureMechanismAssemblyCalculator(kernelFactory); + + // Call + void Call() => calculator.Assemble(null); + + // Assert + var exception = Assert.Throws(Call); + Assert.AreEqual("sectionAssemblyResults", exception.ParamName); + mocks.VerifyAll(); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void AssembleWithFailureMechanismNAndApplyLengthEffect_WithValidInput_ReturnsExpectedOutput(bool applySectionLengthEffect) + { + // Setup var random = new Random(21); + double failureMechanismN = random.NextDouble(); + RiskeerFailureMechanismSectionAssemblyResult[] sectionAssemblyResults = + { + CreateSectionAssemblyResult(random.Next()), + CreateSectionAssemblyResult(random.Next()) + }; using (new AssemblyToolKernelFactoryConfig()) { var factory = (TestAssemblyToolKernelFactory) AssemblyToolKernelFactory.Instance; FailureMechanismAssemblyKernelStub kernel = factory.LastCreatedFailureMechanismAssemblyKernel; - var output = new Probability(random.NextDouble()); - kernel.ProbabilityResult = output; - + kernel.ProbabilityResult = new Probability(random.NextDouble()); + var calculator = new FailureMechanismAssemblyCalculator(factory); // Call - FailureMechanismAssemblyResultWrapper assemblyResultWrapper = calculator.Assemble(Enumerable.Empty()); + calculator.Assemble(failureMechanismN, sectionAssemblyResults, applySectionLengthEffect); // Assert - Assert.IsTrue(kernel.Calculated); - ProbabilityAssert.AreEqual(assemblyResultWrapper.AssemblyResult, output); - Assert.AreEqual(assemblyResultWrapper.AssemblyMethod, AssemblyMethod.BOI1A1); + Assert.AreEqual(failureMechanismN, kernel.LenghtEffectFactor); + Assert.IsFalse(kernel.PartialAssembly); + Assert.AreEqual(sectionAssemblyResults.Length, kernel.FailureMechanismSectionAssemblyResults.Count()); + + // CollectionAssert.AreEqual(sectionAssemblyResults.Select(r => new Probability(r.SectionProbability)), kernel.FailureMechanismSectionProbabilities); + for (var i = 0; i < sectionAssemblyResults.Length; i++) + { + RiskeerFailureMechanismSectionAssemblyResult expected = sectionAssemblyResults.ElementAt(i); + Probability actual = kernel.FailureMechanismSectionAssemblyResults.ElementAt(i); + if (applySectionLengthEffect) + { + ProbabilityAssert.AreEqual(expected.ProfileProbability, actual); + } + else + { + ProbabilityAssert.AreEqual(expected.SectionProbability, actual); + } + } } } - + [Test] - public void Assemble_WithValidOutputWithLengthEffect_ReturnsExpectedOutput() + public void AssembleWithFailureMechanismNAndApplyLengthEffect_WithValidOutput_ReturnsExpectedOutput() { // Setup var random = new Random(21); @@ -228,11 +288,11 @@ FailureMechanismAssemblyKernelStub kernel = factory.LastCreatedFailureMechanismAssemblyKernel; var output = new Probability(random.NextDouble()); kernel.ProbabilityResult = output; - + var calculator = new FailureMechanismAssemblyCalculator(factory); // Call - FailureMechanismAssemblyResultWrapper assemblyResultWrapper = calculator.Assemble(random.NextDouble(),Enumerable.Empty(),true); + FailureMechanismAssemblyResultWrapper assemblyResultWrapper = calculator.Assemble(random.NextDouble(), Enumerable.Empty(), true); // Assert Assert.IsTrue(kernel.Calculated); @@ -242,7 +302,7 @@ } [Test] - public void Assemble_KernelThrowsException_ThrowsFailureMechanismAssemblyCalculatorException() + public void Assemble_WithLenghtEffectKernelThrowsException_ThrowsFailureMechanismAssemblyCalculatorException() { // Setup var random = new Random(21); @@ -260,16 +320,15 @@ random.NextBoolean()); // Assert - Assert.IsFalse(kernel.Calculated); - var exception = Assert.Throws(Call); Assert.IsInstanceOf(exception.InnerException); Assert.AreEqual(AssemblyErrorMessageCreator.CreateGenericErrorMessage(), exception.Message); + Assert.IsFalse(kernel.Calculated); } } [Test] - public void Assemble_KernelThrowsAssemblyException_ThrowsFailureMechanismAssemblyCalculatorException() + public void Assemble_WithLengthEffectKernelThrowsAssemblyException_ThrowsFailureMechanismAssemblyCalculatorException() { // Setup var random = new Random(21); @@ -287,21 +346,14 @@ random.NextBoolean()); // Assert - Assert.IsFalse(kernel.Calculated); - var exception = Assert.Throws(Call); var innerException = exception.InnerException as AssemblyException; Assert.IsNotNull(innerException); Assert.AreEqual(AssemblyErrorMessageCreator.CreateErrorMessage(innerException.Errors), exception.Message); + Assert.IsFalse(kernel.Calculated); } } - private static RiskeerFailureMechanismSectionAssemblyResult CreateSectionAssemblyResult(int seed) - { - var random = new Random(seed); - double probability = random.NextDouble(); - return new RiskeerFailureMechanismSectionAssemblyResult(probability, probability + 0.001, random.NextDouble(), - random.NextEnumValue()); - } + #endregion } } \ No newline at end of file Index: Riskeer/AssemblyTool/test/Riskeer.AssemblyTool.KernelWrapper.TestUtil/Calculators/Assembly/FailureMechanismAssemblyCalculatorStub.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/AssemblyTool/test/Riskeer.AssemblyTool.KernelWrapper.TestUtil/Calculators/Assembly/FailureMechanismAssemblyCalculatorStub.cs (.../FailureMechanismAssemblyCalculatorStub.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/AssemblyTool/test/Riskeer.AssemblyTool.KernelWrapper.TestUtil/Calculators/Assembly/FailureMechanismAssemblyCalculatorStub.cs (.../FailureMechanismAssemblyCalculatorStub.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -56,30 +56,30 @@ /// public FailureMechanismAssemblyResultWrapper AssemblyResultOutput { get; set; } - public FailureMechanismAssemblyResultWrapper Assemble(double failureMechanismN, IEnumerable sectionAssemblyResults, - bool applySectionLengthEffect) + public FailureMechanismAssemblyResultWrapper Assemble(IEnumerable sectionAssemblyResults) { if (ThrowExceptionOnCalculate) { throw new FailureMechanismAssemblyCalculatorException("Message", new Exception()); } - FailureMechanismN = failureMechanismN; SectionAssemblyResultsInput = sectionAssemblyResults; - ApplyLengthEffect = applySectionLengthEffect; - return AssemblyResultOutput ?? (AssemblyResultOutput = new FailureMechanismAssemblyResultWrapper(0.1, AssemblyMethod.BOI1A1)); } - public FailureMechanismAssemblyResultWrapper Assemble(IEnumerable sectionAssemblyResults) + public FailureMechanismAssemblyResultWrapper Assemble(double failureMechanismN, IEnumerable sectionAssemblyResults, + bool applySectionLengthEffect) { if (ThrowExceptionOnCalculate) { throw new FailureMechanismAssemblyCalculatorException("Message", new Exception()); } + FailureMechanismN = failureMechanismN; SectionAssemblyResultsInput = sectionAssemblyResults; - return AssemblyResultOutput ?? (AssemblyResultOutput = new FailureMechanismAssemblyResultWrapper(0.1, AssemblyMethod.BOI1A1)); + ApplyLengthEffect = applySectionLengthEffect; + + return AssemblyResultOutput ?? (AssemblyResultOutput = new FailureMechanismAssemblyResultWrapper(0.1, AssemblyMethod.BOI1A2)); } } } \ No newline at end of file Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Data.Test/ClosingStructuresFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Data.Test/ClosingStructuresFailureMechanismAssemblyFactoryTest.cs (.../ClosingStructuresFailureMechanismAssemblyFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Data.Test/ClosingStructuresFailureMechanismAssemblyFactoryTest.cs (.../ClosingStructuresFailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -78,7 +78,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; failureMechanism.SetSections(new[] @@ -113,7 +113,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1 } }; @@ -140,7 +140,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1 } }; Index: Riskeer/Common/src/Riskeer.Common.Data/AssemblyTool/FailureMechanismAssemblyResultFactory.cs =================================================================== diff -u -r80a56581e3ae390973d398e93f1cc9ac07782941 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/src/Riskeer.Common.Data/AssemblyTool/FailureMechanismAssemblyResultFactory.cs (.../FailureMechanismAssemblyResultFactory.cs) (revision 80a56581e3ae390973d398e93f1cc9ac07782941) +++ Riskeer/Common/src/Riskeer.Common.Data/AssemblyTool/FailureMechanismAssemblyResultFactory.cs (.../FailureMechanismAssemblyResultFactory.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -47,6 +47,7 @@ /// Thrown when /// or is null. /// Thrown when the failure mechanism could not be successfully assembled. + /// Thrown when ProbabilityResultType of the failure mechanism does not support being assembled. public static FailureMechanismAssemblyResultWrapper AssembleFailureMechanism( double failureMechanismN, IEnumerable failureMechanismSectionAssemblyResults, bool applyLengthEffect, FailureMechanismAssemblyResult failureMechanismAssemblyResult) @@ -61,22 +62,29 @@ throw new ArgumentNullException(nameof(failureMechanismAssemblyResult)); } + if (failureMechanismAssemblyResult.ProbabilityResultType == FailureMechanismAssemblyProbabilityResultType.None) + { + throw new AssemblyException(Resources.FailureMechanismAssemblyResultFactory_AssembleFailureMechanism_Missing_input_for_assembly); + } + + if (failureMechanismAssemblyResult.ProbabilityResultType == FailureMechanismAssemblyProbabilityResultType.Manual) + { + return new FailureMechanismAssemblyResultWrapper( + failureMechanismAssemblyResult.ManualFailureMechanismAssemblyProbability, + AssemblyMethod.Manual); + } + try { IFailureMechanismAssemblyCalculator calculator = AssemblyToolCalculatorFactory.Instance.CreateFailureMechanismAssemblyCalculator(AssemblyToolKernelFactory.Instance); + switch (failureMechanismAssemblyResult.ProbabilityResultType) { - case FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections: + case FailureMechanismAssemblyProbabilityResultType.AutomaticP1: return calculator.Assemble(failureMechanismSectionAssemblyResults); - case FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile: + case FailureMechanismAssemblyProbabilityResultType.AutomaticP2: return calculator.Assemble(failureMechanismN, failureMechanismSectionAssemblyResults, applyLengthEffect); - case FailureMechanismAssemblyProbabilityResultType.Manual: - return new FailureMechanismAssemblyResultWrapper( - failureMechanismAssemblyResult.ManualFailureMechanismAssemblyProbability, - AssemblyMethod.Manual); - case FailureMechanismAssemblyProbabilityResultType.None: - throw new AssemblyException(Resources.FailureMechanismAssemblyResultFactory_AssembleFailureMechanism_Missing_input_for_assembly); default: throw new NotSupportedException(); } Index: Riskeer/Common/src/Riskeer.Common.Data/FailureMechanism/FailureMechanismAssemblyProbabilityResultType.cs =================================================================== diff -u -r80a56581e3ae390973d398e93f1cc9ac07782941 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/src/Riskeer.Common.Data/FailureMechanism/FailureMechanismAssemblyProbabilityResultType.cs (.../FailureMechanismAssemblyProbabilityResultType.cs) (revision 80a56581e3ae390973d398e93f1cc9ac07782941) +++ Riskeer/Common/src/Riskeer.Common.Data/FailureMechanism/FailureMechanismAssemblyProbabilityResultType.cs (.../FailureMechanismAssemblyProbabilityResultType.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -30,22 +30,22 @@ public enum FailureMechanismAssemblyProbabilityResultType { /// - /// The default option + /// No Probability type /// - [ResourcesDisplayName(typeof(Resources), nameof(Resources.FailureMechanismAssemblyProbabilityResultTypeDefault_DisplayName))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.FailureMechanismAssemblyProbabilityResultTypeNone_DisplayName))] None = 1, /// /// The automatically calculated probability type based on independent sections. /// - [ResourcesDisplayName(typeof(Resources), nameof(Resources.FailureMechanismAssemblyProbabilityResultTypeAutomaticIndependentSections_DisplayName))] - AutomaticIndependentSections = 2, + [ResourcesDisplayName(typeof(Resources), nameof(Resources.FailureMechanismAssemblyProbabilityResultTypeAutomaticP1_DisplayName))] + AutomaticP1 = 2, /// /// The automatically calculated probability type based on the worst section or profile. /// - [ResourcesDisplayName(typeof(Resources), nameof(Resources.FailureMechanismAssemblyProbabilityResultTypeAutomaticWorstSectionOrProfile_DisplayName))] - AutomaticWorstSectionOrProfile = 3, + [ResourcesDisplayName(typeof(Resources), nameof(Resources.FailureMechanismAssemblyProbabilityResultTypeAutomaticP2_DisplayName))] + AutomaticP2 = 3, /// /// The manual probability type. Index: Riskeer/Common/src/Riskeer.Common.Data/Properties/Resources.Designer.cs =================================================================== diff -u -ra03693d0bb94394ecfdd56a61fcd0d5104380f31 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/src/Riskeer.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision a03693d0bb94394ecfdd56a61fcd0d5104380f31) +++ Riskeer/Common/src/Riskeer.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -1,28 +1,6 @@ -// Copyright (C) Stichting Deltares 2022. 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. - -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -390,38 +368,36 @@ /// /// Looks up a localized string similar to Automatisch berekenen o.b.v. onafhankelijke vakken. /// - public static string FailureMechanismAssemblyProbabilityResultTypeAutomaticIndependentSections_DisplayName { + public static string FailureMechanismAssemblyProbabilityResultTypeAutomaticP1_DisplayName { get { - return ResourceManager.GetString("FailureMechanismAssemblyProbabilityResultTypeAutomaticIndependentSections_Display" + - "Name", resourceCulture); + return ResourceManager.GetString("FailureMechanismAssemblyProbabilityResultTypeAutomaticP1_DisplayName", resourceCulture); } } /// /// Looks up a localized string similar to Automatisch berekenen o.b.v. slechtste doorsnede of vak. /// - public static string FailureMechanismAssemblyProbabilityResultTypeAutomaticWorstSectionOrProfile_DisplayName { + public static string FailureMechanismAssemblyProbabilityResultTypeAutomaticP2_DisplayName { get { - return ResourceManager.GetString("FailureMechanismAssemblyProbabilityResultTypeAutomaticWorstSectionOrProfile_Displ" + - "ayName", resourceCulture); + return ResourceManager.GetString("FailureMechanismAssemblyProbabilityResultTypeAutomaticP2_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to <selecteer>. + /// Looks up a localized string similar to Handmatig invullen. /// - public static string FailureMechanismAssemblyProbabilityResultTypeDefault_DisplayName { + public static string FailureMechanismAssemblyProbabilityResultTypeManual_DisplayName { get { - return ResourceManager.GetString("FailureMechanismAssemblyProbabilityResultTypeDefault_DisplayName", resourceCulture); + return ResourceManager.GetString("FailureMechanismAssemblyProbabilityResultTypeManual_DisplayName", resourceCulture); } } /// - /// Looks up a localized string similar to Handmatig invullen. + /// Looks up a localized string similar to <selecteer>. /// - public static string FailureMechanismAssemblyProbabilityResultTypeManual_DisplayName { + public static string FailureMechanismAssemblyProbabilityResultTypeNone_DisplayName { get { - return ResourceManager.GetString("FailureMechanismAssemblyProbabilityResultTypeManual_DisplayName", resourceCulture); + return ResourceManager.GetString("FailureMechanismAssemblyProbabilityResultTypeNone_DisplayName", resourceCulture); } } Index: Riskeer/Common/src/Riskeer.Common.Data/Properties/Resources.resx =================================================================== diff -u -ra03693d0bb94394ecfdd56a61fcd0d5104380f31 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/src/Riskeer.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision a03693d0bb94394ecfdd56a61fcd0d5104380f31) +++ Riskeer/Common/src/Riskeer.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -393,10 +393,10 @@ Beide - + Automatisch berekenen o.b.v. onafhankelijke vakken - + Automatisch berekenen o.b.v. slechtste doorsnede of vak @@ -408,7 +408,7 @@ NIEUW - + <selecteer> Index: Riskeer/Common/src/Riskeer.Common.Forms/Views/FailureMechanismResultView.Designer.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/src/Riskeer.Common.Forms/Views/FailureMechanismResultView.Designer.cs (.../FailureMechanismResultView.Designer.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/Common/src/Riskeer.Common.Forms/Views/FailureMechanismResultView.Designer.cs (.../FailureMechanismResultView.Designer.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -141,7 +141,7 @@ protected Core.Common.Controls.DataGrid.DataGridViewControl DataGridViewControl; protected System.Windows.Forms.TableLayoutPanel TableLayoutPanel; - protected System.Windows.Forms.ComboBox probabilityResultTypeComboBox; + private System.Windows.Forms.ComboBox probabilityResultTypeComboBox; private System.Windows.Forms.Label failureMechanismAssemblyLabel; private System.Windows.Forms.TextBox failureMechanismAssemblyProbabilityTextBox; private ErrorProvider errorProvider; Index: Riskeer/Common/src/Riskeer.Common.Forms/Views/FailureMechanismResultView.cs =================================================================== diff -u -r80a56581e3ae390973d398e93f1cc9ac07782941 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/src/Riskeer.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision 80a56581e3ae390973d398e93f1cc9ac07782941) +++ Riskeer/Common/src/Riskeer.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -216,8 +216,8 @@ probabilityResultTypeComboBox.Enabled = HasSections(); bool isManualAssembly = FailureMechanism.AssemblyResult.IsManualProbability(); - failureMechanismAssemblyProbabilityTextBox.Enabled = (isManualAssembly && HasSections()) && !IsDefault(); - failureMechanismAssemblyProbabilityTextBox.ReadOnly = !isManualAssembly || !HasSections() || IsDefault(); + failureMechanismAssemblyProbabilityTextBox.Enabled = (isManualAssembly && HasSections()); + failureMechanismAssemblyProbabilityTextBox.ReadOnly = !isManualAssembly || !HasSections(); failureMechanismAssemblyProbabilityTextBox.Refresh(); } @@ -226,30 +226,16 @@ return FailureMechanism.Sections.Any(); } - private bool IsDefault() - { - return (FailureMechanismAssemblyProbabilityResultType) probabilityResultTypeComboBox.SelectedValue == FailureMechanismAssemblyProbabilityResultType.None; - } - private void UpdateAssemblyData() { ClearErrorMessage(); FailureMechanismAssemblyResult assemblyResult = FailureMechanism.AssemblyResult; - switch (assemblyResult.ProbabilityResultType) - { - case FailureMechanismAssemblyProbabilityResultType.Manual: - SetTextBoxValue(assemblyResult.ManualFailureMechanismAssemblyProbability); - validateManualInput(assemblyResult); - return; - case FailureMechanismAssemblyProbabilityResultType.None: - failureMechanismAssemblyProbabilityTextBox.Text = @"-"; - return; - case FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections: - case FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile: - SetTextBoxValue(TryGetFailureMechanismAssemblyProbability()); - return; - } + + double failureMechanismAssemblyProbability = assemblyResult.IsManualProbability() + ? assemblyResult.ManualFailureMechanismAssemblyProbability + : TryGetFailureMechanismAssemblyProbability(); + SetTextBoxValue(failureMechanismAssemblyProbability); } /// @@ -353,7 +339,6 @@ { ClearErrorMessage(); SetTextBoxValue(FailureMechanism.AssemblyResult.ManualFailureMechanismAssemblyProbability); - validateManualInput(FailureMechanism.AssemblyResult); e.Handled = true; } } @@ -367,7 +352,7 @@ private void ProcessFailureMechanismAssemblyProbabilityTextBox() { FailureMechanismAssemblyResult assemblyResult = FailureMechanism.AssemblyResult; - if (!assemblyResult.IsManualProbability() || IsDefault()) + if (!assemblyResult.IsManualProbability()) { return; } @@ -379,7 +364,6 @@ assemblyResult.NotifyObservers(); SetTextBoxValue(probability); - validateManualInput(assemblyResult); } catch (Exception exception) when (exception is ArgumentOutOfRangeException || exception is ProbabilityParsingException) @@ -391,19 +375,20 @@ private void SetTextBoxValue(double probability) { + if (FailureMechanism.AssemblyResult.IsManualProbability()) + { + ValidateManualInput(FailureMechanism.AssemblyResult); + } + failureMechanismAssemblyProbabilityTextBox.Text = ProbabilityFormattingHelper.FormatWithDiscreteNumbers(probability); } - private void validateManualInput(FailureMechanismAssemblyResult assemblyResult) + private void ValidateManualInput(FailureMechanismAssemblyResult assemblyResult) { - if (!HasSections()) - { - SetErrorMessage(Resources.FailureMechanismResultView_To_Enter_An_AssemblyProbability_Failure_Mechanism_Sections_Must_Be_Imported); - } - else - { - SetErrorMessage(FailureMechanismAssemblyResultValidationHelper.GetValidationError(assemblyResult)); - } + string message = HasSections() + ? FailureMechanismAssemblyResultValidationHelper.GetValidationError(assemblyResult) + : Resources.FailureMechanismResultView_To_Enter_An_AssemblyProbability_Failure_Mechanism_Sections_Must_Be_Imported; + SetErrorMessage(message); } private void SetErrorMessage(string errorMessage) Index: Riskeer/Common/test/Riskeer.Common.Data.Test/AssemblyTool/FailureMechanismAssemblyResultFactoryTest.cs =================================================================== diff -u -r80a56581e3ae390973d398e93f1cc9ac07782941 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/test/Riskeer.Common.Data.Test/AssemblyTool/FailureMechanismAssemblyResultFactoryTest.cs (.../FailureMechanismAssemblyResultFactoryTest.cs) (revision 80a56581e3ae390973d398e93f1cc9ac07782941) +++ Riskeer/Common/test/Riskeer.Common.Data.Test/AssemblyTool/FailureMechanismAssemblyResultFactoryTest.cs (.../FailureMechanismAssemblyResultFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -68,9 +68,9 @@ double n = random.NextDouble(); var failureMechanismResult = new FailureMechanismAssemblyResult { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1 }; - const bool applyLengthEffect = true; + bool applyLengthEffect = random.NextBoolean(); IEnumerable sectionResults = Enumerable.Empty(); using (new AssemblyToolCalculatorFactoryConfig()) @@ -96,7 +96,7 @@ double n = random.NextDouble(); var failureMechanismResult = new FailureMechanismAssemblyResult { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 }; bool applyLengthEffect = random.NextBoolean(); IEnumerable sectionResults = Enumerable.Empty(); @@ -117,7 +117,7 @@ } [Test] - public void AssembleFailureMechanism_WithInputWithProbabilityResultTypeDefault_ThrowsAssemblyException() + public void AssembleFailureMechanism_WithInputWithProbabilityResultTypeNone_ThrowsAssemblyException() { // Setup var random = new Random(21); @@ -129,15 +129,12 @@ bool applyLengthEffect = random.NextBoolean(); IEnumerable sectionResults = Enumerable.Empty(); - using (new AssemblyToolCalculatorFactoryConfig()) - { - // Call - void Call() => FailureMechanismAssemblyResultFactory.AssembleFailureMechanism(n, sectionResults, applyLengthEffect, failureMechanismResult); + // Call + void Call() => FailureMechanismAssemblyResultFactory.AssembleFailureMechanism(n, sectionResults, applyLengthEffect, failureMechanismResult); - // Assert - var exception = Assert.Throws(Call); - Assert.AreEqual("Er ontbreekt invoer voor de assemblage rekenmodule waardoor de assemblage niet uitgevoerd kan worden.", exception.Message); - } + // Assert + var exception = Assert.Throws(Call); + Assert.AreEqual("Er ontbreekt invoer voor de assemblage rekenmodule waardoor de assemblage niet uitgevoerd kan worden.", exception.Message); } [Test] @@ -182,7 +179,7 @@ var failureMechanismAssemblyResult = new FailureMechanismAssemblyResult { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1 }; // Call @@ -206,7 +203,7 @@ var failureMechanismAssemblyResult = new FailureMechanismAssemblyResult { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1 }; // Call @@ -221,5 +218,31 @@ Assert.AreEqual(innerException.Message, exception.Message); } } + + [Test] + public void AssembleFailureMechanism_CalculatorThrowsNotSupportedException_ThrowsAssemblyException() + { + // Setup + using (new AssemblyToolCalculatorFactoryConfig()) + { + var calculatorFactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; + FailureMechanismAssemblyCalculatorStub calculator = calculatorFactory.LastCreatedFailureMechanismAssemblyCalculator; + calculator.ThrowExceptionOnCalculate = true; + + var failureMechanismAssemblyResult = new FailureMechanismAssemblyResult + { + ProbabilityResultType = 0 + }; + + // Call + void Call() => + FailureMechanismAssemblyResultFactory.AssembleFailureMechanism( + 0, Enumerable.Empty(), false, failureMechanismAssemblyResult); + + // Assert + var exception = Assert.Throws(Call); + Assert.AreEqual("Specified method is not supported.", exception.Message); + } + } } } \ No newline at end of file Index: Riskeer/Common/test/Riskeer.Common.Data.Test/FailureMechanism/FailureMechanismAssemblyProbabilityResultTypeTest.cs =================================================================== diff -u -r80a56581e3ae390973d398e93f1cc9ac07782941 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/test/Riskeer.Common.Data.Test/FailureMechanism/FailureMechanismAssemblyProbabilityResultTypeTest.cs (.../FailureMechanismAssemblyProbabilityResultTypeTest.cs) (revision 80a56581e3ae390973d398e93f1cc9ac07782941) +++ Riskeer/Common/test/Riskeer.Common.Data.Test/FailureMechanism/FailureMechanismAssemblyProbabilityResultTypeTest.cs (.../FailureMechanismAssemblyProbabilityResultTypeTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -36,10 +36,10 @@ FailureMechanismAssemblyProbabilityResultType.None, 1 }, { - FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections, 2 + FailureMechanismAssemblyProbabilityResultType.AutomaticP1, 2 }, { - FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile, 3 + FailureMechanismAssemblyProbabilityResultType.AutomaticP2, 3 }, { FailureMechanismAssemblyProbabilityResultType.Manual, 4 @@ -53,10 +53,10 @@ FailureMechanismAssemblyProbabilityResultType.None, "" }, { - FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections, "Automatisch berekenen o.b.v. onafhankelijke vakken" + FailureMechanismAssemblyProbabilityResultType.AutomaticP1, "Automatisch berekenen o.b.v. onafhankelijke vakken" }, { - FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile, "Automatisch berekenen o.b.v. slechtste doorsnede of vak" + FailureMechanismAssemblyProbabilityResultType.AutomaticP2, "Automatisch berekenen o.b.v. slechtste doorsnede of vak" }, { FailureMechanismAssemblyProbabilityResultType.Manual, "Handmatig invullen" Index: Riskeer/Common/test/Riskeer.Common.Data.Test/FailureMechanism/FailureMechanismAssemblyResultExtensionsTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/test/Riskeer.Common.Data.Test/FailureMechanism/FailureMechanismAssemblyResultExtensionsTest.cs (.../FailureMechanismAssemblyResultExtensionsTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/Common/test/Riskeer.Common.Data.Test/FailureMechanism/FailureMechanismAssemblyResultExtensionsTest.cs (.../FailureMechanismAssemblyResultExtensionsTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -40,8 +40,8 @@ } [Test] - [TestCase(FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections, false)] - [TestCase(FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile, false)] + [TestCase(FailureMechanismAssemblyProbabilityResultType.AutomaticP1, false)] + [TestCase(FailureMechanismAssemblyProbabilityResultType.AutomaticP2, false)] [TestCase(FailureMechanismAssemblyProbabilityResultType.Manual, true)] public void IsManualProbability_WithFailureMechanismAssemblyProbabilityResultType_ReturnsExpectedResult( FailureMechanismAssemblyProbabilityResultType resultType, bool expectedResult) Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Helpers/FailureMechanismAssemblyResultValidationHelperTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Helpers/FailureMechanismAssemblyResultValidationHelperTest.cs (.../FailureMechanismAssemblyResultValidationHelperTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Helpers/FailureMechanismAssemblyResultValidationHelperTest.cs (.../FailureMechanismAssemblyResultValidationHelperTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -81,7 +81,8 @@ // Setup var result = new FailureMechanismAssemblyResult { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile }; + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + }; // Call string message = FailureMechanismAssemblyResultValidationHelper.GetValidationError(result); Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs =================================================================== diff -u -r12c148380aebf7d0a3df9470ed6285ce96fd2e80 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs (.../FailureMechanismResultViewTest.cs) (revision 12c148380aebf7d0a3df9470ed6285ce96fd2e80) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs (.../FailureMechanismResultViewTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -215,8 +215,8 @@ var configurationTypes = (EnumDisplayWrapper[]) comboBox.DataSource; Assert.AreEqual(4, configurationTypes.Length); Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.None, configurationTypes[0].Value); - Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections, configurationTypes[1].Value); - Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile, configurationTypes[2].Value); + Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticP1, configurationTypes[1].Value); + Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticP2, configurationTypes[2].Value); Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.Manual, configurationTypes[3].Value); Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.None, ((EnumDisplayWrapper) comboBox.SelectedItem).Value); @@ -236,7 +236,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1 } }; int nrOfCalls = 0; @@ -275,7 +275,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1 } }; @@ -318,7 +318,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1 } }; @@ -652,7 +652,7 @@ mocks.ReplayAll(); var failureMechanism = new TestFailureMechanism(); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; TestFailureMechanism failureMechanismInput = null; IAssessmentSection assessmentSectionInput = null; Func performFailureMechanismAssemblyFunc = (fm, ass) => @@ -691,7 +691,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; @@ -701,7 +701,7 @@ { // Precondition ComboBox comboBox = GetProbabilityResultTypeComboBox(); - Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile, comboBox.SelectedValue); + Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticP2, comboBox.SelectedValue); // Then TextBox failureMechanismAssemblyProbabilityTextBox = GetFailureMechanismAssemblyProbabilityTextBox(); @@ -725,7 +725,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; @@ -735,7 +735,7 @@ { // Precondition ComboBox comboBox = GetProbabilityResultTypeComboBox(); - Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile, comboBox.SelectedValue); + Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticP2, comboBox.SelectedValue); // Then TextBox failureMechanismAssemblyProbabilityTextBox = GetFailureMechanismAssemblyProbabilityTextBox(); @@ -764,7 +764,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; @@ -784,7 +784,7 @@ { // Precondition ComboBox comboBox = GetProbabilityResultTypeComboBox(); - Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile, comboBox.SelectedValue); + Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticP2, comboBox.SelectedValue); ErrorProvider errorProvider = GetErrorProvider(view); TextBox failureMechanismAssemblyProbabilityTextBox = GetFailureMechanismAssemblyProbabilityTextBox(); @@ -816,7 +816,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile, + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2, ManualFailureMechanismAssemblyProbability = 0.1 } }; @@ -830,7 +830,7 @@ { // Precondition ComboBox comboBox = GetProbabilityResultTypeComboBox(); - Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile, comboBox.SelectedValue); + Assert.AreEqual(FailureMechanismAssemblyProbabilityResultType.AutomaticP2, comboBox.SelectedValue); ErrorProvider errorProvider = GetErrorProvider(view); TextBox failureMechanismAssemblyProbabilityTextBox = GetFailureMechanismAssemblyProbabilityTextBox(); @@ -861,7 +861,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; @@ -897,8 +897,8 @@ [Test] [SetCulture("nl-NL")] - [TestCase(FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile, FailureMechanismAssemblyProbabilityResultType.Manual)] - [TestCase(FailureMechanismAssemblyProbabilityResultType.Manual, FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile)] + [TestCase(FailureMechanismAssemblyProbabilityResultType.AutomaticP2, FailureMechanismAssemblyProbabilityResultType.Manual)] + [TestCase(FailureMechanismAssemblyProbabilityResultType.Manual, FailureMechanismAssemblyProbabilityResultType.AutomaticP2)] public void GivenFailureMechanismResultView_WhenChangingProbabilityResultType_ThenFailureMechanismAssemblyProbabilityUpdated( FailureMechanismAssemblyProbabilityResultType initialResultType, FailureMechanismAssemblyProbabilityResultType newResultType) @@ -928,7 +928,7 @@ { // Precondition TextBox failureMechanismAssemblyProbabilityTextBox = GetFailureMechanismAssemblyProbabilityTextBox(); - string expectedProbabilityText = initialResultType == FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + string expectedProbabilityText = initialResultType == FailureMechanismAssemblyProbabilityResultType.AutomaticP2 ? assemblyResultText : manualProbabilityText; Assert.AreEqual(expectedProbabilityText, failureMechanismAssemblyProbabilityTextBox.Text); @@ -938,7 +938,7 @@ comboBox.SelectedValue = newResultType; // Then - expectedProbabilityText = newResultType == FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + expectedProbabilityText = newResultType == FailureMechanismAssemblyProbabilityResultType.AutomaticP2 ? assemblyResultText : manualProbabilityText; Assert.AreEqual(expectedProbabilityText, failureMechanismAssemblyProbabilityTextBox.Text); @@ -1134,7 +1134,7 @@ // When ComboBox comboBox = GetProbabilityResultTypeComboBox(); - comboBox.SelectedValue = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile; + comboBox.SelectedValue = FailureMechanismAssemblyProbabilityResultType.AutomaticP2; // Then errorMessage = errorProvider.GetError(failureMechanismAssemblyProbabilityTextBox); @@ -1193,7 +1193,7 @@ #region FailureMechanismAssemblyResultControls [Test] - [TestCase(FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile)] + [TestCase(FailureMechanismAssemblyProbabilityResultType.AutomaticP2)] [TestCase(FailureMechanismAssemblyProbabilityResultType.Manual)] public void FailureMechanismResultView_WithoutSections_FailureMechanismAssemblyResultsCorrectState( FailureMechanismAssemblyProbabilityResultType resultType) @@ -1224,7 +1224,7 @@ } [Test] - [TestCase(FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile)] + [TestCase(FailureMechanismAssemblyProbabilityResultType.AutomaticP2)] [TestCase(FailureMechanismAssemblyProbabilityResultType.Manual)] public void FailureMechanismResultView_WithSections_FailureMechanismAssemblyResultsCorrectState( FailureMechanismAssemblyProbabilityResultType resultType) @@ -1382,7 +1382,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; @@ -1419,7 +1419,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 1"); Index: Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/StructuresFailureMechanismResultViewTest.cs =================================================================== diff -u -r8769c11b9aa8671dffc1c636ed2e1fcddd96146b -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/StructuresFailureMechanismResultViewTest.cs (.../StructuresFailureMechanismResultViewTest.cs) (revision 8769c11b9aa8671dffc1c636ed2e1fcddd96146b) +++ Riskeer/Common/test/Riskeer.Common.Forms.Test/Views/StructuresFailureMechanismResultViewTest.cs (.../StructuresFailureMechanismResultViewTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -365,7 +365,7 @@ : base("Test", "T") { CalculationsGroup = new CalculationGroup(); - AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; } public IEnumerable Calculations => CalculationsGroup.GetCalculations(); Index: Riskeer/DuneErosion/test/Riskeer.DuneErosion.Data.Test/DuneErosionFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/DuneErosion/test/Riskeer.DuneErosion.Data.Test/DuneErosionFailureMechanismAssemblyFactoryTest.cs (.../DuneErosionFailureMechanismAssemblyFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/DuneErosion/test/Riskeer.DuneErosion.Data.Test/DuneErosionFailureMechanismAssemblyFactoryTest.cs (.../DuneErosionFailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -78,7 +78,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; failureMechanism.SetSections(new[] { @@ -112,7 +113,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); @@ -138,7 +140,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismAssemblyFactoryTest.cs (.../GrassCoverErosionInwardsFailureMechanismAssemblyFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismAssemblyFactoryTest.cs (.../GrassCoverErosionInwardsFailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -81,7 +81,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; failureMechanism.SetSections(new[] @@ -116,7 +116,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); @@ -143,7 +144,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); Index: Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismResultViewTest.cs =================================================================== diff -u -r80a56581e3ae390973d398e93f1cc9ac07782941 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismResultViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismResultViewTest.cs) (revision 80a56581e3ae390973d398e93f1cc9ac07782941) +++ Riskeer/GrassCoverErosionInwards/test/Riskeer.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismResultViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismResultViewTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -228,7 +228,7 @@ FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2; FailureMechanismTestHelper.SetSections(failureMechanism, new[] { section @@ -261,7 +261,7 @@ GrassCoverErosionInwardsCalculationScenario calculationScenario = GrassCoverErosionInwardsCalculationScenarioTestFactory.CreateGrassCoverErosionInwardsCalculationScenario(section); failureMechanism.CalculationsGroup.Children.Add(calculationScenario); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; using (new AssemblyToolCalculatorFactoryConfig()) using (ShowFailureMechanismResultsView(failureMechanism)) { @@ -306,7 +306,7 @@ GrassCoverErosionInwardsCalculationScenario calculationScenario = GrassCoverErosionInwardsCalculationScenarioTestFactory.CreateGrassCoverErosionInwardsCalculationScenario(section); failureMechanism.CalculationsGroup.Children.Add(calculationScenario); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; using (new AssemblyToolCalculatorFactoryConfig()) using (ShowFailureMechanismResultsView(failureMechanism)) { @@ -353,7 +353,7 @@ var calculationGroup = new CalculationGroup(); calculationGroup.Children.Add(calculationScenario); failureMechanism.CalculationsGroup.Children.Add(calculationGroup); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; using (new AssemblyToolCalculatorFactoryConfig()) using (ShowFailureMechanismResultsView(failureMechanism)) { Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsFailureMechanismAssemblyFactoryTest.cs (.../GrassCoverErosionOutwardsFailureMechanismAssemblyFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsFailureMechanismAssemblyFactoryTest.cs (.../GrassCoverErosionOutwardsFailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -239,7 +239,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; failureMechanism.SetSections(new[] { @@ -273,7 +274,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); @@ -299,7 +301,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Data.Test/HeightStructuresFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Data.Test/HeightStructuresFailureMechanismAssemblyFactoryTest.cs (.../HeightStructuresFailureMechanismAssemblyFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Data.Test/HeightStructuresFailureMechanismAssemblyFactoryTest.cs (.../HeightStructuresFailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -78,7 +78,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; failureMechanism.SetSections(new[] @@ -113,7 +113,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1 } }; @@ -140,7 +140,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1 } }; Index: Riskeer/Integration/test/Riskeer.Integration.Data.Test/Assembly/AssessmentSectionAssemblyFactoryTest.cs =================================================================== diff -u -r7d112d149bcef01f81aa43c1766b8c4df42de1f5 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Integration/test/Riskeer.Integration.Data.Test/Assembly/AssessmentSectionAssemblyFactoryTest.cs (.../AssessmentSectionAssemblyFactoryTest.cs) (revision 7d112d149bcef01f81aa43c1766b8c4df42de1f5) +++ Riskeer/Integration/test/Riskeer.Integration.Data.Test/Assembly/AssessmentSectionAssemblyFactoryTest.cs (.../AssessmentSectionAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -161,7 +161,7 @@ assessmentSection.GetFailureMechanisms() .Concat(assessmentSection.SpecificFailureMechanisms) .ForEachElementDo( - fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); + fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); return assessmentSection; } @@ -176,7 +176,7 @@ .Concat(assessmentSection.SpecificFailureMechanisms); getAllFailureMechanisms.ForEachElementDo(fp => fp.InAssembly = random.NextBoolean()); getAllFailureMechanisms.ForEachElementDo( - fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); + fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); return assessmentSection; } Index: Riskeer/Integration/test/Riskeer.Integration.Data.Test/StandAlone/AssemblyFactories/FailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Integration/test/Riskeer.Integration.Data.Test/StandAlone/AssemblyFactories/FailureMechanismAssemblyFactoryTest.cs (.../FailureMechanismAssemblyFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/Integration/test/Riskeer.Integration.Data.Test/StandAlone/AssemblyFactories/FailureMechanismAssemblyFactoryTest.cs (.../FailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -251,7 +251,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; failureMechanism.SetSections(new[] { @@ -285,7 +286,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); @@ -311,7 +313,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); Index: Riskeer/Integration/test/Riskeer.Integration.Data.Test/StandAlone/AssemblyFactories/PipingStructureFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Integration/test/Riskeer.Integration.Data.Test/StandAlone/AssemblyFactories/PipingStructureFailureMechanismAssemblyFactoryTest.cs (.../PipingStructureFailureMechanismAssemblyFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/Integration/test/Riskeer.Integration.Data.Test/StandAlone/AssemblyFactories/PipingStructureFailureMechanismAssemblyFactoryTest.cs (.../PipingStructureFailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -80,7 +80,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; failureMechanism.SetSections(new[] { @@ -114,7 +115,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); @@ -140,7 +142,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Factories/FailureMechanismAssemblyResultRowFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Factories/FailureMechanismAssemblyResultRowFactoryTest.cs (.../FailureMechanismAssemblyResultRowFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Factories/FailureMechanismAssemblyResultRowFactoryTest.cs (.../FailureMechanismAssemblyResultRowFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -105,7 +105,8 @@ failureMechanism.Stub(fm => fm.Code).Return(failureMechanismCode); failureMechanism.Stub(fm => fm.AssemblyResult).Return(new FailureMechanismAssemblyResult { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile }); + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + }); mocks.ReplayAll(); failureMechanism.InAssembly = true; @@ -141,7 +142,8 @@ failureMechanism.Stub(fm => fm.Code).Return(failureMechanismCode); failureMechanism.Stub(fm => fm.AssemblyResult).Return(new FailureMechanismAssemblyResult { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile }); + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + }); mocks.ReplayAll(); failureMechanism.InAssembly = true; Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs =================================================================== diff -u -r80a56581e3ae390973d398e93f1cc9ac07782941 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs (.../AssemblyResultTotalViewTest.cs) (revision 80a56581e3ae390973d398e93f1cc9ac07782941) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs (.../AssemblyResultTotalViewTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -169,7 +169,7 @@ { // Given AssessmentSection assessmentSection = CreateAssessmentSection(); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2); using (new AssemblyToolCalculatorFactoryConfig()) { @@ -192,7 +192,7 @@ { // Given AssessmentSection assessmentSection = CreateAssessmentSection(); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2); using (new AssemblyToolCalculatorFactoryConfig()) using (ShowAssemblyResultTotalView(assessmentSection)) @@ -207,7 +207,7 @@ { // Given AssessmentSection assessmentSection = CreateAssessmentSection(); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2); using (new AssemblyToolCalculatorFactoryConfig()) using (ShowAssemblyResultTotalView(assessmentSection)) @@ -237,7 +237,7 @@ { // Given AssessmentSection assessmentSection = CreateAssessmentSection(); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2); using (new AssemblyToolCalculatorFactoryConfig()) using (ShowAssemblyResultTotalView(assessmentSection)) @@ -265,7 +265,7 @@ { // Given AssessmentSection assessmentSection = CreateAssessmentSection(); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2); using (new AssemblyToolCalculatorFactoryConfig()) { @@ -451,7 +451,7 @@ { // Given AssessmentSection assessmentSection = CreateAssessmentSection(); - assessmentSection.Piping.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + assessmentSection.Piping.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; using (new AssemblyToolCalculatorFactoryConfig()) using (AssemblyResultTotalView view = ShowAssemblyResultTotalView(assessmentSection)) @@ -488,7 +488,7 @@ { // Given AssessmentSection assessmentSection = CreateAssessmentSection(); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2); using (new AssemblyToolCalculatorFactoryConfig()) using (AssemblyResultTotalView view = ShowAssemblyResultTotalView(assessmentSection)) @@ -509,7 +509,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1 } }; specificFailureMechanisms.Add(specificFailureMechanism); @@ -531,8 +531,8 @@ // Given AssessmentSection assessmentSection = CreateAssessmentSection(); AddSpecificFailureMechanisms(assessmentSection); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile); - assessmentSection.SpecificFailureMechanisms.ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2); + assessmentSection.SpecificFailureMechanisms.ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2); using (new AssemblyToolCalculatorFactoryConfig()) using (AssemblyResultTotalView view = ShowAssemblyResultTotalView(assessmentSection)) Index: Riskeer/Integration/test/Riskeer.Integration.IO.Test/Exporters/AssemblyExporterTest.cs =================================================================== diff -u -r535735859c84cb8dff86fed16ec47a0020eaec9d -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Integration/test/Riskeer.Integration.IO.Test/Exporters/AssemblyExporterTest.cs (.../AssemblyExporterTest.cs) (revision 535735859c84cb8dff86fed16ec47a0020eaec9d) +++ Riskeer/Integration/test/Riskeer.Integration.IO.Test/Exporters/AssemblyExporterTest.cs (.../AssemblyExporterTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -102,8 +102,8 @@ string filePath = TestHelper.GetScratchPadPath(nameof(Export_SpecificFailureMechanismsWithSameName_ExpectedResultBasedOnInAssemblyState)); AssessmentSection assessmentSection = CreateConfiguredAssessmentSection(); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); - assessmentSection.SpecificFailureMechanisms.ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); + assessmentSection.SpecificFailureMechanisms.ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); SpecificFailureMechanism specificFailureMechanism1 = assessmentSection.SpecificFailureMechanisms.ElementAt(0); SpecificFailureMechanism specificFailureMechanism2 = assessmentSection.SpecificFailureMechanisms.ElementAt(1); @@ -197,8 +197,8 @@ string filePath = Path.Combine(folderPath, "actualAssembly.gml"); AssessmentSection assessmentSection = CreateConfiguredAssessmentSection(); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); - assessmentSection.SpecificFailureMechanisms.ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); + assessmentSection.SpecificFailureMechanisms.ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); var exporter = new AssemblyExporter(assessmentSection, filePath); @@ -233,8 +233,8 @@ // Setup string filePath = TestHelper.GetScratchPadPath(nameof(Export_InvalidDirectoryRights_LogsErrorAndReturnsFalse)); AssessmentSection assessmentSection = CreateConfiguredAssessmentSection(); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); - assessmentSection.SpecificFailureMechanisms.ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); + assessmentSection.SpecificFailureMechanisms.ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); var exporter = new AssemblyExporter(assessmentSection, filePath); Index: Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssemblyFactoryTest.cs =================================================================== diff -u -r808c29a1d1dd8b7cf78d3936ab7315017017efcd -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssemblyFactoryTest.cs (.../ExportableAssemblyFactoryTest.cs) (revision 808c29a1d1dd8b7cf78d3936ab7315017017efcd) +++ Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssemblyFactoryTest.cs (.../ExportableAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -62,8 +62,8 @@ new SpecificFailureMechanism() } }; - assessmentSection.SpecificFailureMechanisms.ForEachElementDo(sfm => sfm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); + assessmentSection.SpecificFailureMechanisms.ForEachElementDo(sfm => sfm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); ReferenceLineTestFactory.SetReferenceLineGeometry(assessmentSection.ReferenceLine); AddFailureMechanismSections(assessmentSection); Index: Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssessmentSectionFactoryTest.cs =================================================================== diff -u -r2c1499125b98e1487d567a3be7af63bf550192d0 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssessmentSectionFactoryTest.cs (.../ExportableAssessmentSectionFactoryTest.cs) (revision 2c1499125b98e1487d567a3be7af63bf550192d0) +++ Riskeer/Integration/test/Riskeer.Integration.IO.Test/Factories/ExportableAssessmentSectionFactoryTest.cs (.../ExportableAssessmentSectionFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -85,8 +85,8 @@ assessmentSection.SpecificFailureMechanisms.Add(new SpecificFailureMechanism()); assessmentSection.SpecificFailureMechanisms.Add(new SpecificFailureMechanism()); - assessmentSection.SpecificFailureMechanisms.ForEachElementDo(sfm => sfm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); - assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections); + assessmentSection.SpecificFailureMechanisms.ForEachElementDo(sfm => sfm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); + assessmentSection.GetFailureMechanisms().ForEachElementDo(fm => fm.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1); AddFailureMechanismSections(assessmentSection); Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Data.Test/MacroStabilityInwardsFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Data.Test/MacroStabilityInwardsFailureMechanismAssemblyFactoryTest.cs (.../MacroStabilityInwardsFailureMechanismAssemblyFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Data.Test/MacroStabilityInwardsFailureMechanismAssemblyFactoryTest.cs (.../MacroStabilityInwardsFailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -245,7 +245,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; failureMechanism.SetSections(new[] { @@ -280,7 +281,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); @@ -306,7 +308,8 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile } + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 + } }; var assessmentSection = new AssessmentSectionStub(); Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismResultViewTest.cs =================================================================== diff -u -r902ff3a37930732fbe578f6b1ab4f1591d9e5a53 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismResultViewTest.cs (.../MacroStabilityInwardsFailureMechanismResultViewTest.cs) (revision 902ff3a37930732fbe578f6b1ab4f1591d9e5a53) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsFailureMechanismResultViewTest.cs (.../MacroStabilityInwardsFailureMechanismResultViewTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -208,7 +208,7 @@ FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2; FailureMechanismTestHelper.SetSections(failureMechanism, new[] { section @@ -242,7 +242,7 @@ MacroStabilityInwardsCalculationScenario calculationScenario = MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenario(section); failureMechanism.CalculationsGroup.Children.Add(calculationScenario); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; using (new AssemblyToolCalculatorFactoryConfig()) using (ShowFailureMechanismResultsView(failureMechanism)) @@ -288,7 +288,7 @@ MacroStabilityInwardsCalculationScenario calculationScenario = MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenario(section); failureMechanism.CalculationsGroup.Children.Add(calculationScenario); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; using (new AssemblyToolCalculatorFactoryConfig()) using (ShowFailureMechanismResultsView(failureMechanism)) @@ -336,7 +336,7 @@ var calculationGroup = new CalculationGroup(); calculationGroup.Children.Add(calculationScenario); failureMechanism.CalculationsGroup.Children.Add(calculationGroup); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; using (new AssemblyToolCalculatorFactoryConfig()) using (ShowFailureMechanismResultsView(failureMechanism)) Index: Riskeer/Piping/test/Riskeer.Piping.Data.Test/PipingFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r12c148380aebf7d0a3df9470ed6285ce96fd2e80 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Piping/test/Riskeer.Piping.Data.Test/PipingFailureMechanismAssemblyFactoryTest.cs (.../PipingFailureMechanismAssemblyFactoryTest.cs) (revision 12c148380aebf7d0a3df9470ed6285ce96fd2e80) +++ Riskeer/Piping/test/Riskeer.Piping.Data.Test/PipingFailureMechanismAssemblyFactoryTest.cs (.../PipingFailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -252,7 +252,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; failureMechanism.SetSections(new[] @@ -288,7 +288,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; @@ -315,7 +315,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; Index: Riskeer/Piping/test/Riskeer.Piping.Forms.Test/Views/PipingFailureMechanismResultViewTest.cs =================================================================== diff -u -r902ff3a37930732fbe578f6b1ab4f1591d9e5a53 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/Piping/test/Riskeer.Piping.Forms.Test/Views/PipingFailureMechanismResultViewTest.cs (.../PipingFailureMechanismResultViewTest.cs) (revision 902ff3a37930732fbe578f6b1ab4f1591d9e5a53) +++ Riskeer/Piping/test/Riskeer.Piping.Forms.Test/Views/PipingFailureMechanismResultViewTest.cs (.../PipingFailureMechanismResultViewTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -222,7 +222,7 @@ FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); var failureMechanism = new PipingFailureMechanism(); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2; FailureMechanismTestHelper.SetSections(failureMechanism, new[] { section @@ -252,7 +252,7 @@ { FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 1") }); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; var calculationScenario = new TestPipingCalculationScenario(); failureMechanism.CalculationsGroup.Children.Add(calculationScenario); @@ -299,7 +299,7 @@ var calculationScenario = new TestPipingCalculationScenario(); failureMechanism.CalculationsGroup.Children.Add(calculationScenario); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; using (new AssemblyToolCalculatorFactoryConfig()) using (ShowFailureMechanismResultsView(failureMechanism)) @@ -346,7 +346,7 @@ var calculationGroup = new CalculationGroup(); calculationGroup.Children.Add(calculationScenario); failureMechanism.CalculationsGroup.Children.Add(calculationGroup); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; using (new AssemblyToolCalculatorFactoryConfig()) using (ShowFailureMechanismResultsView(failureMechanism)) @@ -388,7 +388,7 @@ { FailureMechanismSectionTestFactory.CreateFailureMechanismSection("Section 1") }); - failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticIndependentSections; + failureMechanism.AssemblyResult.ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP1; using (new AssemblyToolCalculatorFactoryConfig()) using (ShowFailureMechanismResultsView(failureMechanism)) Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Data.Test/StabilityPointStructuresFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Data.Test/StabilityPointStructuresFailureMechanismAssemblyFactoryTest.cs (.../StabilityPointStructuresFailureMechanismAssemblyFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Data.Test/StabilityPointStructuresFailureMechanismAssemblyFactoryTest.cs (.../StabilityPointStructuresFailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -78,7 +78,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; failureMechanism.SetSections(new[] @@ -113,7 +113,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; @@ -140,7 +140,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Data.Test/StabilityStoneCoverFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Data.Test/StabilityStoneCoverFailureMechanismAssemblyFactoryTest.cs (.../StabilityStoneCoverFailureMechanismAssemblyFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Data.Test/StabilityStoneCoverFailureMechanismAssemblyFactoryTest.cs (.../StabilityStoneCoverFailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -239,7 +239,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; failureMechanism.SetSections(new[] @@ -274,7 +274,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; @@ -301,7 +301,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Data.Test/WaveImpactAsphaltCoverFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r21db6e69fc90b3abcb46f2154edc9a88cf862cb7 -r7d4dbbbd491634aba27874344b308618e90365df --- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Data.Test/WaveImpactAsphaltCoverFailureMechanismAssemblyFactoryTest.cs (.../WaveImpactAsphaltCoverFailureMechanismAssemblyFactoryTest.cs) (revision 21db6e69fc90b3abcb46f2154edc9a88cf862cb7) +++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Data.Test/WaveImpactAsphaltCoverFailureMechanismAssemblyFactoryTest.cs (.../WaveImpactAsphaltCoverFailureMechanismAssemblyFactoryTest.cs) (revision 7d4dbbbd491634aba27874344b308618e90365df) @@ -239,7 +239,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; failureMechanism.SetSections(new[] @@ -275,7 +275,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } }; @@ -302,7 +302,7 @@ { AssemblyResult = { - ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticWorstSectionOrProfile + ProbabilityResultType = FailureMechanismAssemblyProbabilityResultType.AutomaticP2 } };