Index: Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Data.Test/ClosingStructuresFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -r89796712386c9c6cdb332d605d109618a61caba7 -r07acf75162ed9a68532f5a5c404eb23ada3c0359 --- Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Data.Test/ClosingStructuresFailureMechanismAssemblyFactoryTest.cs (.../ClosingStructuresFailureMechanismAssemblyFactoryTest.cs) (revision 89796712386c9c6cdb332d605d109618a61caba7) +++ Riskeer/ClosingStructures/test/Riskeer.ClosingStructures.Data.Test/ClosingStructuresFailureMechanismAssemblyFactoryTest.cs (.../ClosingStructuresFailureMechanismAssemblyFactoryTest.cs) (revision 07acf75162ed9a68532f5a5c404eb23ada3c0359) @@ -59,10 +59,10 @@ public void AssembleSimpleAssessment_FailureMechanismSectionResultNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.AssembleSimpleAssessment(null); + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.AssembleSimpleAssessment(null); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanismSectionResult", exception.ParamName); } @@ -126,10 +126,10 @@ calculator.ThrowExceptionOnCalculate = true; // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.AssembleSimpleAssessment(sectionResult); + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.AssembleSimpleAssessment(sectionResult); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); Assert.AreEqual(innerException.Message, exception.Message); @@ -321,13 +321,11 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( - null, - new ClosingStructuresFailureMechanism(), - assessmentSection); + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( + null, new ClosingStructuresFailureMechanism(), assessmentSection); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanismSectionResult", exception.ParamName); mocks.VerifyAll(); } @@ -341,13 +339,12 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( new ClosingStructuresFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection()), - null, - assessmentSection); + null, assessmentSection); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); mocks.VerifyAll(); } @@ -356,13 +353,12 @@ public void AssembleTailorMadeAssessment_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( new ClosingStructuresFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection()), - new ClosingStructuresFailureMechanism(), - null); + new ClosingStructuresFailureMechanism(), null); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("assessmentSection", exception.ParamName); } @@ -447,13 +443,11 @@ calculator.ThrowExceptionOnCalculate = true; // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( - sectionResult, - failureMechanism, - assessmentSection); + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( + sectionResult, failureMechanism, assessmentSection); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); Assert.AreEqual(innerException.Message, exception.Message); @@ -680,14 +674,11 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( - null, - new ClosingStructuresFailureMechanism(), - assessmentSection, - new Random(39).NextBoolean()); + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + null, new ClosingStructuresFailureMechanism(), assessmentSection, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanismSectionResult", exception.ParamName); mocks.VerifyAll(); } @@ -701,14 +692,12 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( new ClosingStructuresFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection()), - null, - assessmentSection, - new Random(39).NextBoolean()); + null, assessmentSection, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); mocks.VerifyAll(); } @@ -717,14 +706,12 @@ public void GetSectionAssemblyCategoryGroup_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( new ClosingStructuresFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection()), - new ClosingStructuresFailureMechanism(), - null, - new Random(39).NextBoolean()); + new ClosingStructuresFailureMechanism(), null, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("assessmentSection", exception.ParamName); } @@ -964,14 +951,11 @@ } // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( - sectionResult, - failureMechanism, - assessmentSection, - useManualAssembly); + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + sectionResult, failureMechanism, assessmentSection, useManualAssembly); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); Assert.AreEqual(innerException.Message, exception.Message); @@ -992,13 +976,11 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( - null, - assessmentSection, - new Random(39).NextBoolean()); + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( + null, assessmentSection, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); mocks.VerifyAll(); } @@ -1007,13 +989,11 @@ public void AssembleFailureMechanism_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( - new ClosingStructuresFailureMechanism(), - null, - new Random(39).NextBoolean()); + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( + new ClosingStructuresFailureMechanism(), null, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("assessmentSection", exception.ParamName); } @@ -1188,13 +1168,11 @@ calculator.ThrowExceptionOnCalculate = true; // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( - failureMechanism, - assessmentSection, - new Random(39).NextBoolean()); + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( + failureMechanism, assessmentSection, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); Assert.AreEqual(innerException.Message, exception.Message); @@ -1223,13 +1201,11 @@ calculator.ThrowExceptionOnCalculateCombinedAssembly = true; // Call - TestDelegate call = () => ClosingStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( - failureMechanism, - assessmentSection, - new Random(39).NextBoolean()); + void Call() => ClosingStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( + failureMechanism, assessmentSection, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); Assert.AreEqual("Voor een of meerdere vakken kan geen resultaat worden bepaald.", exception.Message); Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Data.Test/HeightStructuresFailureMechanismAssemblyFactoryTest.cs =================================================================== diff -u -rb0d25d2dab3c6ba9b1aff684a0cf41f842e0ec29 -r07acf75162ed9a68532f5a5c404eb23ada3c0359 --- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Data.Test/HeightStructuresFailureMechanismAssemblyFactoryTest.cs (.../HeightStructuresFailureMechanismAssemblyFactoryTest.cs) (revision b0d25d2dab3c6ba9b1aff684a0cf41f842e0ec29) +++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Data.Test/HeightStructuresFailureMechanismAssemblyFactoryTest.cs (.../HeightStructuresFailureMechanismAssemblyFactoryTest.cs) (revision 07acf75162ed9a68532f5a5c404eb23ada3c0359) @@ -59,10 +59,10 @@ public void AssembleSimpleAssessment_FailureMechanismSectionResultNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.AssembleSimpleAssessment(null); + void Call() => HeightStructuresFailureMechanismAssemblyFactory.AssembleSimpleAssessment(null); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanismSectionResult", exception.ParamName); } @@ -126,10 +126,10 @@ calculator.ThrowExceptionOnCalculate = true; // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.AssembleSimpleAssessment(sectionResult); + void Call() => HeightStructuresFailureMechanismAssemblyFactory.AssembleSimpleAssessment(sectionResult); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); Assert.AreEqual(innerException.Message, exception.Message); @@ -321,13 +321,11 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( - null, - new HeightStructuresFailureMechanism(), - assessmentSection); + void Call() => HeightStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( + null, new HeightStructuresFailureMechanism(), assessmentSection); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanismSectionResult", exception.ParamName); mocks.VerifyAll(); } @@ -341,13 +339,12 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( + void Call() => HeightStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( new HeightStructuresFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection()), - null, - assessmentSection); + null, assessmentSection); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); mocks.VerifyAll(); } @@ -356,13 +353,12 @@ public void AssembleTailorMadeAssessment_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( + void Call() => HeightStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( new HeightStructuresFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection()), - new HeightStructuresFailureMechanism(), - null); + new HeightStructuresFailureMechanism(), null); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("assessmentSection", exception.ParamName); } @@ -447,13 +443,11 @@ calculator.ThrowExceptionOnCalculate = true; // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( - sectionResult, - failureMechanism, - assessmentSection); + void Call() => HeightStructuresFailureMechanismAssemblyFactory.AssembleTailorMadeAssessment( + sectionResult, failureMechanism, assessmentSection); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); Assert.AreEqual(innerException.Message, exception.Message); @@ -680,14 +674,11 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( - null, - new HeightStructuresFailureMechanism(), - assessmentSection, - new Random(39).NextBoolean()); + void Call() => HeightStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + null, new HeightStructuresFailureMechanism(), assessmentSection, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanismSectionResult", exception.ParamName); mocks.VerifyAll(); } @@ -701,14 +692,12 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + void Call() => HeightStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( new HeightStructuresFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection()), - null, - assessmentSection, - new Random(39).NextBoolean()); + null, assessmentSection, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); mocks.VerifyAll(); } @@ -717,14 +706,12 @@ public void GetSectionAssemblyCategoryGroup_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + void Call() => HeightStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( new HeightStructuresFailureMechanismSectionResult(FailureMechanismSectionTestFactory.CreateFailureMechanismSection()), - new HeightStructuresFailureMechanism(), - null, - new Random(39).NextBoolean()); + new HeightStructuresFailureMechanism(), null, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("assessmentSection", exception.ParamName); } @@ -964,14 +951,11 @@ } // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( - sectionResult, - failureMechanism, - assessmentSection, - useManualAssembly); + void Call() => HeightStructuresFailureMechanismAssemblyFactory.GetSectionAssemblyCategoryGroup( + sectionResult, failureMechanism, assessmentSection, useManualAssembly); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); Assert.AreEqual(innerException.Message, exception.Message); @@ -992,13 +976,11 @@ mocks.ReplayAll(); // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( - null, - assessmentSection, - new Random(39).NextBoolean()); + void Call() => HeightStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( + null, assessmentSection, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("failureMechanism", exception.ParamName); mocks.VerifyAll(); } @@ -1007,13 +989,11 @@ public void AssembleFailureMechanism_AssessmentSectionNull_ThrowsArgumentNullException() { // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( - new HeightStructuresFailureMechanism(), - null, - new Random(39).NextBoolean()); + void Call() => HeightStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( + new HeightStructuresFailureMechanism(), null, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Assert.AreEqual("assessmentSection", exception.ParamName); } @@ -1188,13 +1168,11 @@ calculator.ThrowExceptionOnCalculate = true; // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( - failureMechanism, - assessmentSection, - new Random(39).NextBoolean()); + void Call() => HeightStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( + failureMechanism, assessmentSection, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); Assert.AreEqual(innerException.Message, exception.Message); @@ -1223,13 +1201,11 @@ calculator.ThrowExceptionOnCalculateCombinedAssembly = true; // Call - TestDelegate call = () => HeightStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( - failureMechanism, - assessmentSection, - new Random(39).NextBoolean()); + void Call() => HeightStructuresFailureMechanismAssemblyFactory.AssembleFailureMechanism( + failureMechanism, assessmentSection, new Random(39).NextBoolean()); // Assert - var exception = Assert.Throws(call); + var exception = Assert.Throws(Call); Exception innerException = exception.InnerException; Assert.IsInstanceOf(innerException); Assert.AreEqual("Voor een of meerdere vakken kan geen resultaat worden bepaald.", exception.Message); Index: Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/FileImporters/StabilityPointStructureReplaceDataStrategyTest.cs =================================================================== diff -u -r2330bb2cc25cca151199beb380598672f27e65b5 -r07acf75162ed9a68532f5a5c404eb23ada3c0359 --- Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/FileImporters/StabilityPointStructureReplaceDataStrategyTest.cs (.../StabilityPointStructureReplaceDataStrategyTest.cs) (revision 2330bb2cc25cca151199beb380598672f27e65b5) +++ Riskeer/StabilityPointStructures/test/Riskeer.StabilityPointStructures.Plugin.Test/FileImporters/StabilityPointStructureReplaceDataStrategyTest.cs (.../StabilityPointStructureReplaceDataStrategyTest.cs) (revision 07acf75162ed9a68532f5a5c404eb23ada3c0359) @@ -23,7 +23,6 @@ using System.Collections.Generic; using System.Linq; using Core.Common.Base; -using Core.Common.Base.Geometry; using NUnit.Framework; using Riskeer.Common.Data; using Riskeer.Common.Data.Exceptions; @@ -335,52 +334,5 @@ targetCollection }, affectedObjects); } - - [Test] - public void UpdateStructuresWithImportedData_CalculationWithSectionResultAndStructure_CalculationUpdatedAndReturnsAffectedObject() - { - // Setup - var location = new Point2D(12, 34); - var structure = new TestStabilityPointStructure(location); - var calculation = new TestStabilityPointStructuresCalculationScenario - { - InputParameters = - { - Structure = structure - } - }; - - var failureMechanism = new StabilityPointStructuresFailureMechanism(); - failureMechanism.CalculationsGroup.Children.Add(calculation); - FailureMechanismTestHelper.SetSections(failureMechanism, new[] - { - FailureMechanismSectionTestFactory.CreateFailureMechanismSection(new[] - { - location - }) - }); - - StructureCollection targetCollection = failureMechanism.StabilityPointStructures; - targetCollection.AddRange(new[] - { - structure - }, sourcePath); - - var strategy = new StabilityPointStructureReplaceDataStrategy(failureMechanism); - - // Call - IEnumerable affectedObjects = strategy.UpdateStructuresWithImportedData(Enumerable.Empty(), - sourcePath); - - // Assert - Assert.IsNull(calculation.InputParameters.Structure); - - CollectionAssert.IsEmpty(targetCollection); - CollectionAssert.AreEquivalent(new IObservable[] - { - calculation.InputParameters, - targetCollection - }, affectedObjects); - } } } \ No newline at end of file