Fisheye: Tag 922504df809b08d203bdd5d504445e8b64cfd412 refers to a dead (removed) revision in file `Riskeer/HeightStructures/src/Riskeer.HeightStructures.Data/HeightStructuresProbabilityAssessmentOutputFactory.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenarioRow.cs =================================================================== diff -u -r35349144a21f4e3627505605840f286b21b2d004 -r922504df809b08d203bdd5d504445e8b64cfd412 --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenarioRow.cs (.../HeightStructuresScenarioRow.cs) (revision 35349144a21f4e3627505605840f286b21b2d004) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenarioRow.cs (.../HeightStructuresScenarioRow.cs) (revision 922504df809b08d203bdd5d504445e8b64cfd412) @@ -20,7 +20,6 @@ // All rights reserved. using System; -using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.Probability; using Riskeer.Common.Data.Structures; using Riskeer.Common.Forms.Views; @@ -34,35 +33,16 @@ /// public class HeightStructuresScenarioRow : ScenarioRow> { - private readonly HeightStructuresFailureMechanism failureMechanism; - private readonly IAssessmentSection assessmentSection; private ProbabilityAssessmentOutput probabilityAssessmentOutput; /// /// Creates a new instance of . /// The this row contains. - /// The failure mechanism that the calculation belongs to. - /// The assessment section that the calculation belongs to. /// Thrown when any parameter is null. /// - public HeightStructuresScenarioRow(StructuresCalculationScenario calculationScenario, - HeightStructuresFailureMechanism failureMechanism, - IAssessmentSection assessmentSection) + public HeightStructuresScenarioRow(StructuresCalculationScenario calculationScenario) : base(calculationScenario) { - if (failureMechanism == null) - { - throw new ArgumentNullException(nameof(failureMechanism)); - } - - if (assessmentSection == null) - { - throw new ArgumentNullException(nameof(assessmentSection)); - } - - this.failureMechanism = failureMechanism; - this.assessmentSection = assessmentSection; - CreateProbabilityAssessmentOutput(); } @@ -76,8 +56,7 @@ private void CreateProbabilityAssessmentOutput() { probabilityAssessmentOutput = CalculationScenario.HasOutput - ? HeightStructuresProbabilityAssessmentOutputFactory.Create( - CalculationScenario.Output, failureMechanism, assessmentSection) + ? ProbabilityAssessmentOutputFactory.Create(CalculationScenario.Output.Reliability) : null; } } Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs =================================================================== diff -u -r35349144a21f4e3627505605840f286b21b2d004 -r922504df809b08d203bdd5d504445e8b64cfd412 --- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs (.../HeightStructuresScenariosView.cs) (revision 35349144a21f4e3627505605840f286b21b2d004) +++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/Views/HeightStructuresScenariosView.cs (.../HeightStructuresScenariosView.cs) (revision 922504df809b08d203bdd5d504445e8b64cfd412) @@ -71,7 +71,7 @@ .OfType>() .Where(cs => cs.IsStructureIntersectionWithReferenceLineInSection(lineSegments)); - return calculations.Select(c => new HeightStructuresScenarioRow(c, FailureMechanism, assessmentSection)).ToList(); + return calculations.Select(c => new HeightStructuresScenarioRow(c)).ToList(); } } } \ No newline at end of file Fisheye: Tag 922504df809b08d203bdd5d504445e8b64cfd412 refers to a dead (removed) revision in file `Riskeer/HeightStructures/test/Riskeer.HeightStructures.Data.Test/HeightStructuresProbabilityAssessmentOutputFactoryTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Data.Test/Riskeer.HeightStructures.Data.Test.csproj =================================================================== diff -u -r08e8d26a0715f0f3db57c1d3e86256aa06934db4 -r922504df809b08d203bdd5d504445e8b64cfd412 --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Data.Test/Riskeer.HeightStructures.Data.Test.csproj (.../Riskeer.HeightStructures.Data.Test.csproj) (revision 08e8d26a0715f0f3db57c1d3e86256aa06934db4) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Data.Test/Riskeer.HeightStructures.Data.Test.csproj (.../Riskeer.HeightStructures.Data.Test.csproj) (revision 922504df809b08d203bdd5d504445e8b64cfd412) @@ -10,18 +10,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresOutputPropertiesTest.cs =================================================================== diff -u -r30265d6f789bfc2aae0afa668ade298a9f721e3b -r922504df809b08d203bdd5d504445e8b64cfd412 --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresOutputPropertiesTest.cs (.../HeightStructuresOutputPropertiesTest.cs) (revision 30265d6f789bfc2aae0afa668ade298a9f721e3b) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresOutputPropertiesTest.cs (.../HeightStructuresOutputPropertiesTest.cs) (revision 922504df809b08d203bdd5d504445e8b64cfd412) @@ -21,13 +21,10 @@ using System; using NUnit.Framework; -using Rhino.Mocks; -using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.Probability; using Riskeer.Common.Data.TestUtil; using Riskeer.Common.Forms.Helpers; using Riskeer.Common.Forms.PropertyClasses; -using Riskeer.HeightStructures.Data; using Riskeer.HeightStructures.Forms.PropertyClasses; namespace Riskeer.HeightStructures.Forms.Test.PropertyClasses @@ -53,12 +50,6 @@ public void GetProperties_WithData_ReturnExpectedValues() { // Setup - var failureMechanism = new HeightStructuresFailureMechanism(); - - var mocks = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(failureMechanism, mocks); - mocks.ReplayAll(); - var random = new Random(39); double reliability = random.NextDouble(); @@ -68,11 +59,9 @@ var properties = new HeightStructuresOutputProperties(structuresOutput); // Assert - ProbabilityAssessmentOutput expectedProbabilityAssessmentOutput = HeightStructuresProbabilityAssessmentOutputFactory.Create( - structuresOutput, failureMechanism, assessmentSection); + ProbabilityAssessmentOutput expectedProbabilityAssessmentOutput = ProbabilityAssessmentOutputFactory.Create(reliability); Assert.AreEqual(ProbabilityFormattingHelper.Format(expectedProbabilityAssessmentOutput.Probability), properties.Probability); Assert.AreEqual(expectedProbabilityAssessmentOutput.Reliability, properties.Reliability, properties.Reliability.GetAccuracy()); - mocks.VerifyAll(); } } } \ No newline at end of file Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/Views/HeightStructuresScenarioRowTest.cs =================================================================== diff -u -r35349144a21f4e3627505605840f286b21b2d004 -r922504df809b08d203bdd5d504445e8b64cfd412 --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/Views/HeightStructuresScenarioRowTest.cs (.../HeightStructuresScenarioRowTest.cs) (revision 35349144a21f4e3627505605840f286b21b2d004) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/Views/HeightStructuresScenarioRowTest.cs (.../HeightStructuresScenarioRowTest.cs) (revision 922504df809b08d203bdd5d504445e8b64cfd412) @@ -21,8 +21,6 @@ using System; using NUnit.Framework; -using Rhino.Mocks; -using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.Probability; using Riskeer.Common.Data.Structures; using Riskeer.Common.Data.TestUtil; @@ -38,26 +36,19 @@ [Test] public void Constructor_FailureMechanismNull_ThrowsArgumentNullException() { - // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - // Call - void Call() => new HeightStructuresScenarioRow(new StructuresCalculationScenario(), null, assessmentSection); + void Call() => new HeightStructuresScenarioRow(new StructuresCalculationScenario()); // Assert var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); - mocks.VerifyAll(); } [Test] public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - void Call() => new HeightStructuresScenarioRow(new StructuresCalculationScenario(), - new HeightStructuresFailureMechanism(), null); + void Call() => new HeightStructuresScenarioRow(new StructuresCalculationScenario()); // Assert var exception = Assert.Throws(Call); @@ -68,79 +59,53 @@ public void Constructor_ExpectedValues() { // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - var calculation = new StructuresCalculationScenario(); // Call - var row = new HeightStructuresScenarioRow(calculation, new HeightStructuresFailureMechanism(), assessmentSection); + var row = new HeightStructuresScenarioRow(calculation); // Assert Assert.IsInstanceOf>>(row); Assert.AreSame(calculation, row.CalculationScenario); - mocks.VerifyAll(); } [Test] public void Constructor_WithCalculationWithOutput_PropertiesFromCalculation() { // Setup - var failureMechanism = new HeightStructuresFailureMechanism(); - - var mocks = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(failureMechanism, mocks); - mocks.ReplayAll(); - var calculation = new StructuresCalculationScenario { Output = new TestStructuresOutput() }; // Call - var row = new HeightStructuresScenarioRow(calculation, failureMechanism, assessmentSection); + var row = new HeightStructuresScenarioRow(calculation); // Assert - ProbabilityAssessmentOutput expectedDerivedOutput = HeightStructuresProbabilityAssessmentOutputFactory.Create( - calculation.Output, failureMechanism, assessmentSection); + ProbabilityAssessmentOutput expectedDerivedOutput = ProbabilityAssessmentOutputFactory.Create(calculation.Output.Reliability); Assert.AreEqual(expectedDerivedOutput.Probability, row.FailureProbability); - mocks.VerifyAll(); } [Test] public void Constructor_WithCalculationWithoutOutput_PropertiesFromCalculation() { // Setup - var failureMechanism = new HeightStructuresFailureMechanism(); - - var mocks = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(failureMechanism, mocks); - mocks.ReplayAll(); - var calculation = new StructuresCalculationScenario(); // Call - var row = new HeightStructuresScenarioRow(calculation, failureMechanism, assessmentSection); + var row = new HeightStructuresScenarioRow(calculation); // Assert Assert.IsNaN(row.FailureProbability); - mocks.VerifyAll(); } [Test] public void GivenScenarioRow_WhenOutputSetAndUpdate_ThenDerivedOutputUpdated() { // Given - var failureMechanism = new HeightStructuresFailureMechanism(); - - var mocks = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(failureMechanism, mocks); - mocks.ReplayAll(); - var calculation = new StructuresCalculationScenario(); - var row = new HeightStructuresScenarioRow(calculation, failureMechanism, assessmentSection); + var row = new HeightStructuresScenarioRow(calculation); // Precondition Assert.IsNaN(row.FailureProbability); @@ -150,32 +115,23 @@ row.Update(); // Then - ProbabilityAssessmentOutput expectedDerivedOutput = HeightStructuresProbabilityAssessmentOutputFactory.Create( - calculation.Output, failureMechanism, assessmentSection); + ProbabilityAssessmentOutput expectedDerivedOutput = ProbabilityAssessmentOutputFactory.Create(calculation.Output.Reliability); Assert.AreEqual(expectedDerivedOutput.Probability, row.FailureProbability); - mocks.VerifyAll(); } [Test] public void GivenScenarioRow_WhenOutputSetToNullAndUpdate_ThenDerivedOutputUpdated() { // Given - var failureMechanism = new HeightStructuresFailureMechanism(); - - var mocks = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(failureMechanism, mocks); - mocks.ReplayAll(); - var calculation = new StructuresCalculationScenario { Output = new TestStructuresOutput() }; - var row = new HeightStructuresScenarioRow(calculation, failureMechanism, assessmentSection); + var row = new HeightStructuresScenarioRow(calculation); // Precondition - ProbabilityAssessmentOutput expectedDerivedOutput = HeightStructuresProbabilityAssessmentOutputFactory.Create( - calculation.Output, failureMechanism, assessmentSection); + ProbabilityAssessmentOutput expectedDerivedOutput = ProbabilityAssessmentOutputFactory.Create(calculation.Output.Reliability); Assert.AreEqual(expectedDerivedOutput.Probability, row.FailureProbability); // When @@ -184,29 +140,21 @@ // Then Assert.IsNaN(row.FailureProbability); - mocks.VerifyAll(); } [Test] public void GivenScenarioRow_WhenOutputChangedAndUpdate_ThenDerivedOutputUpdated() { // Given - var failureMechanism = new HeightStructuresFailureMechanism(); - - var mocks = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(failureMechanism, mocks); - mocks.ReplayAll(); - var calculation = new StructuresCalculationScenario { Output = new TestStructuresOutput() }; - var row = new HeightStructuresScenarioRow(calculation, failureMechanism, assessmentSection); + var row = new HeightStructuresScenarioRow(calculation); // Precondition - ProbabilityAssessmentOutput expectedDerivedOutput = HeightStructuresProbabilityAssessmentOutputFactory.Create( - calculation.Output, failureMechanism, assessmentSection); + ProbabilityAssessmentOutput expectedDerivedOutput = ProbabilityAssessmentOutputFactory.Create(calculation.Output.Reliability); Assert.AreEqual(expectedDerivedOutput.Probability, row.FailureProbability); var random = new Random(11); @@ -216,10 +164,8 @@ row.Update(); // Then - ProbabilityAssessmentOutput newExpectedDerivedOutput = HeightStructuresProbabilityAssessmentOutputFactory.Create( - calculation.Output, failureMechanism, assessmentSection); + ProbabilityAssessmentOutput newExpectedDerivedOutput = ProbabilityAssessmentOutputFactory.Create(calculation.Output.Reliability); Assert.AreEqual(newExpectedDerivedOutput.Probability, row.FailureProbability); - mocks.VerifyAll(); } } } \ No newline at end of file