Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresCalculationContextTest.cs =================================================================== diff -u -rab20c4eb4ca81bd3845d50210d2bdb301177af6a -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresCalculationContextTest.cs (.../ClosingStructuresCalculationContextTest.cs) (revision ab20c4eb4ca81bd3845d50210d2bdb301177af6a) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresCalculationContextTest.cs (.../ClosingStructuresCalculationContextTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -37,21 +37,21 @@ { // Setup var mocksRepository = new MockRepository(); - var assessmentSectionMock = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); mocksRepository.ReplayAll(); var calculation = new StructuresCalculation(); var failureMechanism = new ClosingStructuresFailureMechanism(); // Call - var context = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var context = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf, ClosingStructuresFailureMechanism>>(context); Assert.IsInstanceOf, ClosingStructuresFailureMechanism>>(context); Assert.AreEqual(calculation, context.WrappedData); Assert.AreEqual(failureMechanism, context.FailureMechanism); - Assert.AreEqual(assessmentSectionMock, context.AssessmentSection); + Assert.AreEqual(assessmentSection, context.AssessmentSection); mocksRepository.VerifyAll(); } } Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresCalculationGroupContextTest.cs =================================================================== diff -u -rca23b1b155ca87c0aa4665fd919727570f31c781 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresCalculationGroupContextTest.cs (.../ClosingStructuresCalculationGroupContextTest.cs) (revision ca23b1b155ca87c0aa4665fd919727570f31c781) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresCalculationGroupContextTest.cs (.../ClosingStructuresCalculationGroupContextTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -37,21 +37,21 @@ { // Setup var mockRepository = new MockRepository(); - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); var calculationGroup = new CalculationGroup(); var failureMechanism = new ClosingStructuresFailureMechanism(); // Call - var groupContext = new ClosingStructuresCalculationGroupContext(calculationGroup, failureMechanism, assessmentSectionMock); + var groupContext = new ClosingStructuresCalculationGroupContext(calculationGroup, failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf>(groupContext); Assert.IsInstanceOf>(groupContext); Assert.AreSame(calculationGroup, groupContext.WrappedData); Assert.AreSame(failureMechanism, groupContext.FailureMechanism); - Assert.AreSame(assessmentSectionMock, groupContext.AssessmentSection); + Assert.AreSame(assessmentSection, groupContext.AssessmentSection); mockRepository.VerifyAll(); } } Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresContextTest.cs =================================================================== diff -u -r8c1fffbb415e7c2470be6d3fa2971103777d418e -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresContextTest.cs (.../ClosingStructuresContextTest.cs) (revision 8c1fffbb415e7c2470be6d3fa2971103777d418e) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresContextTest.cs (.../ClosingStructuresContextTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -38,19 +38,19 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new ClosingStructuresFailureMechanism(); // Call - var context = new ClosingStructuresContext(failureMechanism.ClosingStructures, failureMechanism, assessmentSectionStub); + var context = new ClosingStructuresContext(failureMechanism.ClosingStructures, failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf>>(context); Assert.AreSame(failureMechanism, failureMechanism); Assert.AreSame(failureMechanism.ClosingStructures, context.WrappedData); - Assert.AreSame(assessmentSectionStub, context.AssessmentSection); + Assert.AreSame(assessmentSection, context.AssessmentSection); mocks.VerifyAll(); } Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresFailureMechanismContextTest.cs =================================================================== diff -u -r8c1fffbb415e7c2470be6d3fa2971103777d418e -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresFailureMechanismContextTest.cs (.../ClosingStructuresFailureMechanismContextTest.cs) (revision 8c1fffbb415e7c2470be6d3fa2971103777d418e) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresFailureMechanismContextTest.cs (.../ClosingStructuresFailureMechanismContextTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -36,17 +36,17 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new ClosingStructuresFailureMechanism(); // Call - var context = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionStub); + var context = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf>(context); - Assert.AreSame(assessmentSectionStub, context.Parent); + Assert.AreSame(assessmentSection, context.Parent); Assert.AreSame(failureMechanism, context.WrappedData); mocks.VerifyAll(); } Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresInputContextTest.cs =================================================================== diff -u -r8c1fffbb415e7c2470be6d3fa2971103777d418e -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresInputContextTest.cs (.../ClosingStructuresInputContextTest.cs) (revision 8c1fffbb415e7c2470be6d3fa2971103777d418e) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Forms.Test/PresentationObjects/ClosingStructuresInputContextTest.cs (.../ClosingStructuresInputContextTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -37,21 +37,21 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var calculation = new StructuresCalculation(); var failureMechanism = new ClosingStructuresFailureMechanism(); // Call - var context = new ClosingStructuresInputContext(calculation.InputParameters, calculation, failureMechanism, assessmentSectionStub); + var context = new ClosingStructuresInputContext(calculation.InputParameters, calculation, failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf, ClosingStructuresFailureMechanism>>(context); Assert.AreSame(calculation.InputParameters, context.WrappedData); Assert.AreSame(calculation, context.Calculation); Assert.AreSame(failureMechanism, context.FailureMechanism); - Assert.AreSame(assessmentSectionStub, context.AssessmentSection); + Assert.AreSame(assessmentSection, context.AssessmentSection); mocks.VerifyAll(); } } Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresFailureMechanismContextPropertyInfoTest.cs =================================================================== diff -u -r0ff7a1a433c8c0835cbf2657cec049d6f2b168c7 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresFailureMechanismContextPropertyInfoTest.cs (.../ClosingStructuresFailureMechanismContextPropertyInfoTest.cs) (revision 0ff7a1a433c8c0835cbf2657cec049d6f2b168c7) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresFailureMechanismContextPropertyInfoTest.cs (.../ClosingStructuresFailureMechanismContextPropertyInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -62,7 +62,7 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new ClosingStructuresFailureMechanism(); Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresInputContextPropertyInfoTest.cs =================================================================== diff -u -r54feee4bbc803da593586d0c19de638dccf5c621 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresInputContextPropertyInfoTest.cs (.../ClosingStructuresInputContextPropertyInfoTest.cs) (revision 54feee4bbc803da593586d0c19de638dccf5c621) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/PropertyInfos/ClosingStructuresInputContextPropertyInfoTest.cs (.../ClosingStructuresInputContextPropertyInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -63,7 +63,7 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var calculation = new TestClosingStructuresCalculation(); Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r08d1e0071c50b67ff8c6a6eba6ec47734d714182 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationContextTreeNodeInfoTest.cs) (revision 08d1e0071c50b67ff8c6a6eba6ec47734d714182) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationContextTreeNodeInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -127,12 +127,12 @@ [Test] public void ChildNodeObjects_CalculationWithoutOutput_ReturnCollectionWithEmptyOutputObject() { - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new ClosingStructuresFailureMechanism(); var calculation = new StructuresCalculation(); - var calculationContext = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var calculationContext = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSection); // Call var children = info.ChildNodeObjects(calculationContext).ToArray(); @@ -153,7 +153,7 @@ [Test] public void ChildNodeObjects_CalculationWithOutput_ReturnCollectionWithOutputObject() { - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new ClosingStructuresFailureMechanism(); @@ -162,7 +162,7 @@ Output = new TestStructuresOutput() }; - var calculationContext = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var calculationContext = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSection); // Call var children = info.ChildNodeObjects(calculationContext).ToArray(); @@ -185,9 +185,9 @@ { // Setup var failureMechanism = new ClosingStructuresFailureMechanism(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var calculation = new StructuresCalculation(); - var nodeData = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var nodeData = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSection); var menuBuilderMock = mocks.StrictMock(); using (mocks.Ordered()) @@ -225,21 +225,23 @@ public void ContextMenuStrip_Always_AddCustomItems() { // Setup + string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); + + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + { + FilePath = validFilePath, + Version = "random" + }; + var failureMechanism = new TestClosingStructuresFailureMechanism(); - var assessmentSection = mocks.StrictMock(); var calculation = new StructuresCalculation(); var nodeData = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); using (var treeViewControl = new TreeViewControl()) { guiMock.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(menuBuilder); - assessmentSection.Stub(asm => asm.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase - { - FilePath = validFilePath, - Version = "random" - }); mocks.ReplayAll(); @@ -274,10 +276,10 @@ public void ContextMenuStrip_NoHydraulicBoundaryDatabase_ContextMenuItemPerformCalculationAndValidationDisabledAndTooltipSet() { // Setup - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var calculation = new StructuresCalculation(); var failureMechanism = new TestClosingStructuresFailureMechanism(); - var nodeData = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var nodeData = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -310,12 +312,12 @@ public void ContextMenuStrip_HydraulicBoundaryDatabaseNotValid_ContextMenuItemPerformCalculationAndValidationDisabledAndTooltipSet() { // Setup - var assessmentSectionStub = mocks.Stub(); - assessmentSectionStub.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); var calculation = new StructuresCalculation(); var failureMechanism = new TestClosingStructuresFailureMechanism(); - var nodeData = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var nodeData = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -358,12 +360,12 @@ Version = "1.0" }; - var assessmentSectionStub = mocks.Stub(); - assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; var calculation = new StructuresCalculation(); var failureMechanism = new ClosingStructuresFailureMechanism(); - var nodeData = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var nodeData = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -404,12 +406,12 @@ Version = "1.0" }; - var assessmentSectionStub = mocks.Stub(); - assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; var calculation = new StructuresCalculation(); var failureMechanism = new TestClosingStructuresFailureMechanism(); - var nodeData = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var nodeData = new ClosingStructuresCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r6436e221712515fd3c7c5fdea39bd4266dbeb555 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision 6436e221712515fd3c7c5fdea39bd4266dbeb555) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -547,10 +547,10 @@ var failureMechanism = new ClosingStructuresFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var nodeData = new ClosingStructuresCalculationGroupContext(group, failureMechanism, - assessmentSectionStub); + assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); @@ -561,7 +561,7 @@ mocks.ReplayAll(); - assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; // Call using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl)) @@ -605,10 +605,10 @@ var failureMechanism = new TestClosingStructuresFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var nodeData = new ClosingStructuresCalculationGroupContext(group, failureMechanism, - assessmentSectionStub); + assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); @@ -619,7 +619,7 @@ mocks.ReplayAll(); - assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; // Call using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl)) @@ -883,7 +883,7 @@ // Given using (var treeViewControl = new TreeViewControl()) { - var assessmentSection = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); ClosingStructure structure1 = new TestClosingStructure("Structure 1"); ClosingStructure structure2 = new TestClosingStructure("Structure 2"); @@ -941,7 +941,7 @@ // Given using (var treeViewControl = new TreeViewControl()) { - var assessmentSection = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); ClosingStructure structure1 = new TestClosingStructure("Structure 1"); ClosingStructure structure2 = new TestClosingStructure("Structure 2"); @@ -1066,15 +1066,15 @@ // Setup var observerMock = mocks.StrictMock(); var failureMechanism = new ClosingStructuresFailureMechanism(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var group = new CalculationGroup(); var parentGroup = new CalculationGroup(); var nodeData = new ClosingStructuresCalculationGroupContext(group, failureMechanism, - assessmentSectionStub); + assessmentSection); var parentNodeData = new ClosingStructuresCalculationGroupContext(parentGroup, failureMechanism, - assessmentSectionStub); + assessmentSection); observerMock.Expect(o => o.UpdateObserver()); @@ -1098,15 +1098,15 @@ { // Setup var failureMechanism = new ClosingStructuresFailureMechanism(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var group = new CalculationGroup(); var parentGroup = new CalculationGroup(); var nodeData = new ClosingStructuresCalculationGroupContext(group, failureMechanism, - assessmentSectionStub); + assessmentSection); var parentNodeData = new ClosingStructuresCalculationGroupContext(parentGroup, failureMechanism, - assessmentSectionStub); + assessmentSection); mocks.ReplayAll(); @@ -1135,16 +1135,16 @@ { // Setup var observerMock = mocks.StrictMock(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var failureMechanism = new ClosingStructuresFailureMechanism(); var group = new CalculationGroup(); var parentGroup = new CalculationGroup(); var nodeData = new ClosingStructuresCalculationGroupContext(group, failureMechanism, - assessmentSectionStub); + assessmentSection); var parentNodeData = new ClosingStructuresCalculationGroupContext(parentGroup, failureMechanism, - assessmentSectionStub); + assessmentSection); var calculation = new StructuresCalculation(); observerMock.Expect(o => o.UpdateObserver()); Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r6436e221712515fd3c7c5fdea39bd4266dbeb555 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision 6436e221712515fd3c7c5fdea39bd4266dbeb555) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -111,11 +111,11 @@ public void ChildNodeObjects_FailureMechanismIsRelevant_ReturnChildDataNodes() { // Setup - var assessmentSectionStub = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); mocksRepository.ReplayAll(); var failureMechanism = new ClosingStructuresFailureMechanism(); - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionStub); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); // Call var children = info.ChildNodeObjects(failureMechanismContext).ToArray(); @@ -130,17 +130,17 @@ Assert.AreEqual(4, inputsFolder.Contents.Count); var failureMechanismSectionsContext = (FailureMechanismSectionsContext) inputsFolder.Contents[0]; Assert.AreSame(failureMechanism, failureMechanismSectionsContext.WrappedData); - Assert.AreSame(assessmentSectionStub, failureMechanismSectionsContext.ParentAssessmentSection); + Assert.AreSame(assessmentSection, failureMechanismSectionsContext.ParentAssessmentSection); var profilesContext = (ForeshoreProfilesContext) inputsFolder.Contents[1]; Assert.AreSame(failureMechanism.ForeshoreProfiles, profilesContext.WrappedData); Assert.AreSame(failureMechanism, profilesContext.ParentFailureMechanism); - Assert.AreSame(assessmentSectionStub, profilesContext.ParentAssessmentSection); + Assert.AreSame(assessmentSection, profilesContext.ParentAssessmentSection); var closingStructuresContext = (ClosingStructuresContext) inputsFolder.Contents[2]; Assert.AreSame(failureMechanism.ClosingStructures, closingStructuresContext.WrappedData); Assert.AreSame(failureMechanism, closingStructuresContext.FailureMechanism); - Assert.AreSame(assessmentSectionStub, closingStructuresContext.AssessmentSection); + Assert.AreSame(assessmentSection, closingStructuresContext.AssessmentSection); var inputComment = (Comment) inputsFolder.Contents[3]; Assert.AreSame(failureMechanism.InputComments, inputComment); @@ -171,14 +171,14 @@ public void ChildNodeObjects_FailureMechanismIsNotRelevant_ReturnOnlyFailureMechanismNotRelevantComments() { // Setup - var assessmentSectionStub = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); mocksRepository.ReplayAll(); var failureMechanism = new ClosingStructuresFailureMechanism { IsRelevant = false }; - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionStub); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); // Call var children = info.ChildNodeObjects(failureMechanismContext).ToArray(); @@ -194,8 +194,8 @@ { // Setup var failureMechanism = new ClosingStructuresFailureMechanism(); - var assessmentSectionMock = mocksRepository.Stub(); - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); var guiMock = mocksRepository.StrictMock(); var menuBuilderMock = mocksRepository.StrictMock(); @@ -240,8 +240,8 @@ { IsRelevant = false }; - var assessmentSectionMock = mocksRepository.Stub(); - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); var guiMock = mocksRepository.StrictMock(); var menuBuilderMock = mocksRepository.StrictMock(); @@ -275,9 +275,9 @@ // Setup using (var treeView = new TreeViewControl()) { - var assessmentSectionMock = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); var failureMechanism = new ClosingStructuresFailureMechanism(); - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); @@ -289,7 +289,7 @@ plugin.Gui = guiMock; // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSectionMock, treeView)) + using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSection, treeView)) { // Assert Assert.AreEqual(13, menu.Items.Count); @@ -325,12 +325,12 @@ // Setup using (var treeView = new TreeViewControl()) { - var assessmentSectionMock = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); var failureMechanism = new ClosingStructuresFailureMechanism { IsRelevant = false }; - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); @@ -342,7 +342,7 @@ plugin.Gui = guiMock; // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSectionMock, treeView)) + using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSection, treeView)) { // Assert Assert.AreEqual(4, menu.Items.Count); @@ -360,8 +360,8 @@ { // Setup var failureMechanism = new ClosingStructuresFailureMechanism(); - var assessmentSectionStub = mocksRepository.Stub(); - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionStub); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); var viewCommandsMock = mocksRepository.StrictMock(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); @@ -395,8 +395,8 @@ { IsRelevant = false }; - var assessmentSectionStub = mocksRepository.Stub(); - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionStub); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); var viewCommandsMock = mocksRepository.StrictMock(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); @@ -430,9 +430,9 @@ var failureMechanism = new TestClosingStructuresFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); - var assessmentSectionMock = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); - var nodeData = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); + var nodeData = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -632,12 +632,12 @@ var hydraulicBoundaryDatabaseStub = mocksRepository.Stub(); hydraulicBoundaryDatabaseStub.FilePath = validFilePath; - var assessmentSectionStub = mocksRepository.Stub(); - assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; - assessmentSectionStub.Stub(a => a.Id).Return(string.Empty); - assessmentSectionStub.Stub(a => a.FailureMechanismContribution).Return(new FailureMechanismContribution(Enumerable.Empty(), 1, 1)); + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; + assessmentSection.Stub(a => a.Id).Return(string.Empty); + assessmentSection.Stub(a => a.FailureMechanismContribution).Return(new FailureMechanismContribution(Enumerable.Empty(), 1, 1)); - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionStub); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -707,10 +707,10 @@ var hydraulicBoundaryDatabaseStub = mocksRepository.Stub(); hydraulicBoundaryDatabaseStub.FilePath = validFilePath; - var assessmentSectionMock = mocksRepository.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismResultViewInfoTest.cs =================================================================== diff -u -r5586f52de59cc0f9a350161b00cb9e63dcda0b5c -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismResultViewInfoTest.cs (.../ClosingStructuresFailureMechanismResultViewInfoTest.cs) (revision 5586f52de59cc0f9a350161b00cb9e63dcda0b5c) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismResultViewInfoTest.cs (.../ClosingStructuresFailureMechanismResultViewInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -134,8 +134,8 @@ public void CloseForData_AssessmentSectionRemovedWithoutFailureMechanism_ReturnsFalse() { // Setup - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); + var assessmentSection = mocks.Stub(); + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); mocks.ReplayAll(); using (var view = new ClosingStructuresFailureMechanismResultView()) @@ -144,7 +144,7 @@ view.Data = failureMechanism.SectionResults; // Call - var closeForData = info.CloseForData(view, assessmentSectionMock); + var closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsFalse(closeForData); @@ -156,13 +156,13 @@ public void CloseForData_ViewNotCorrespondingToRemovedAssessmentSection_ReturnsFalse() { // Setup - var assessmentSectionMock = mocks.StrictMock(); - var failureMechanismMock = mocks.Stub("N", "C"); + var assessmentSection = mocks.Stub(); var failureMechanism = new ClosingStructuresFailureMechanism(); + var otherFailureMechanism = mocks.Stub("N", "C"); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new[] + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new[] { - failureMechanismMock + otherFailureMechanism }); mocks.ReplayAll(); @@ -172,7 +172,7 @@ view.Data = failureMechanism.SectionResults; // Call - var closeForData = info.CloseForData(view, assessmentSectionMock); + var closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsFalse(closeForData); @@ -184,10 +184,10 @@ public void CloseForData_ViewCorrespondingToRemovedAssessmentSection_ReturnsTrue() { // Setup - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var failureMechanism = new ClosingStructuresFailureMechanism(); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[] + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[] { new TestFailureMechanism(), failureMechanism @@ -200,7 +200,7 @@ view.Data = failureMechanism.SectionResults; // Call - var closeForData = info.CloseForData(view, assessmentSectionMock); + var closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsTrue(closeForData); @@ -246,11 +246,11 @@ public void CloseForData_ViewCorrespondingToRemovedFailureMechanismContext_ReturnsTrue() { // Setup - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new ClosingStructuresFailureMechanism(); - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); using (var view = new ClosingStructuresFailureMechanismResultView()) { @@ -269,7 +269,7 @@ public void CloseForData_ViewNotCorrespondingToRemovedFailureMechanism_ReturnsFalse() { // Setup - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new ClosingStructuresFailureMechanism(); @@ -278,7 +278,7 @@ view.Data = failureMechanism.SectionResults; var failureMechanismContext = new ClosingStructuresFailureMechanismContext(new ClosingStructuresFailureMechanism(), - assessmentSectionMock); + assessmentSection); // Call var closeForData = info.CloseForData(view, failureMechanismContext); Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismViewInfoTest.cs =================================================================== diff -u -r2c595d68a6fb2abeebed64c607fa2a3ab806f483 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismViewInfoTest.cs (.../ClosingStructuresFailureMechanismViewInfoTest.cs) (revision 2c595d68a6fb2abeebed64c607fa2a3ab806f483) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismViewInfoTest.cs (.../ClosingStructuresFailureMechanismViewInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -86,20 +86,20 @@ public void CloseForData_ViewNotCorrespondingToRemovedAssessmentSection_ReturnsFalse() { // Setup - var assessmentSectionStub = mocks.Stub(); - var otherAssessmentSectionMock = mocks.Stub(); + var assessmentSection = mocks.Stub(); + var otherAssessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new ClosingStructuresFailureMechanism(); - var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionStub); + var failureMechanismContext = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); using (var view = new ClosingStructuresFailureMechanismView { Data = failureMechanismContext }) { // Call - bool closeForData = info.CloseForData(view, otherAssessmentSectionMock); + bool closeForData = info.CloseForData(view, otherAssessmentSection); // Assert Assert.IsFalse(closeForData); Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresScenariosViewInfoTest.cs =================================================================== diff -u -r8c1fffbb415e7c2470be6d3fa2971103777d418e -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresScenariosViewInfoTest.cs (.../ClosingStructuresScenariosViewInfoTest.cs) (revision 8c1fffbb415e7c2470be6d3fa2971103777d418e) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresScenariosViewInfoTest.cs (.../ClosingStructuresScenariosViewInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -244,8 +244,8 @@ public void CloseForData_AssessmentSectionRemovedWithoutClosingStructuresFailureMechanism_ReturnsFalse() { // Setup - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); + var assessmentSection = mocks.Stub(); + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); mocks.ReplayAll(); var view = new ClosingStructuresScenariosView @@ -254,7 +254,7 @@ }; // Call - bool closeForData = info.CloseForData(view, assessmentSectionMock); + bool closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsFalse(closeForData); @@ -265,8 +265,8 @@ public void CloseForData_ViewNotCorrespondingToRemovedAssessmentSection_ReturnsFalse() { // Setup - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new[] + var assessmentSection = mocks.Stub(); + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new[] { new ClosingStructuresFailureMechanism() }); @@ -279,7 +279,7 @@ }; // Call - bool closeForData = info.CloseForData(view, assessmentSectionMock); + bool closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsFalse(closeForData); @@ -290,9 +290,9 @@ public void CloseForData_ViewCorrespondingToRemovedAssessmentSection_ReturnsTrue() { // Setup - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var failureMechanism = new ClosingStructuresFailureMechanism(); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new[] + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new[] { failureMechanism }); @@ -305,7 +305,7 @@ }; // Call - bool closeForData = info.CloseForData(view, assessmentSectionMock); + bool closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsTrue(closeForData); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContextTest.cs =================================================================== diff -u -re775448bfb8290e43d62340a53a08723bbc035c6 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContextTest.cs (.../FailureMechanismContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContextTest.cs (.../FailureMechanismContextTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -37,18 +37,18 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); - var failureMechanismMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); + var failureMechanism = mocks.Stub(); mocks.ReplayAll(); // Call - var context = new SimpleFailureMechanismContext(failureMechanismMock, assessmentSectionMock); + var context = new SimpleFailureMechanismContext(failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf>(context); Assert.IsInstanceOf>(context); - Assert.AreSame(assessmentSectionMock, context.Parent); - Assert.AreSame(failureMechanismMock, context.WrappedData); + Assert.AreSame(assessmentSection, context.Parent); + Assert.AreSame(failureMechanism, context.WrappedData); mocks.VerifyAll(); } @@ -57,11 +57,11 @@ { // Setup var mocks = new MockRepository(); - var failureMechanismMock = mocks.StrictMock(); + var failureMechanism = mocks.Stub(); mocks.ReplayAll(); // Call - TestDelegate test = () => new SimpleFailureMechanismContext(failureMechanismMock, null); + TestDelegate test = () => new SimpleFailureMechanismContext(failureMechanism, null); // Assert var exception = Assert.Throws(test); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContributionContextTest.cs =================================================================== diff -u -r753480c9461b7b5bb10eb7abe78224f24160a536 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContributionContextTest.cs (.../FailureMechanismContributionContextTest.cs) (revision 753480c9461b7b5bb10eb7abe78224f24160a536) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismContributionContextTest.cs (.../FailureMechanismContributionContextTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -39,19 +39,19 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanisms = Enumerable.Empty(); var contribution = new FailureMechanismContribution(failureMechanisms, 1.1, 1.0/30000); // Call - var context = new FailureMechanismContributionContext(contribution, assessmentSectionMock); + var context = new FailureMechanismContributionContext(contribution, assessmentSection); // Assert Assert.IsInstanceOf>(context); Assert.AreSame(contribution, context.WrappedData); - Assert.AreSame(assessmentSectionMock, context.Parent); + Assert.AreSame(assessmentSection, context.Parent); mocks.VerifyAll(); } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismSectionsContextTest.cs =================================================================== diff -u -re775448bfb8290e43d62340a53a08723bbc035c6 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismSectionsContextTest.cs (.../FailureMechanismSectionsContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/FailureMechanismSectionsContextTest.cs (.../FailureMechanismSectionsContextTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -53,18 +53,18 @@ }; var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); - var failureMechanismMock = mocks.StrictMock(); - failureMechanismMock.Stub(fm => fm.Sections).Return(sectionsSequence); + var assessmentSection = mocks.Stub(); + var failureMechanism = mocks.Stub(); + failureMechanism.Stub(fm => fm.Sections).Return(sectionsSequence); mocks.ReplayAll(); // Call - var context = new FailureMechanismSectionsContext(failureMechanismMock, assessmentSectionMock); + var context = new FailureMechanismSectionsContext(failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf>(context); - Assert.AreSame(failureMechanismMock, context.WrappedData); - Assert.AreSame(assessmentSectionMock, context.ParentAssessmentSection); + Assert.AreSame(failureMechanism, context.WrappedData); + Assert.AreSame(assessmentSection, context.ParentAssessmentSection); mocks.VerifyAll(); } @@ -73,11 +73,11 @@ { // Setup var mocks = new MockRepository(); - var failureMechanismMock = mocks.StrictMock(); + var failureMechanism = mocks.Stub(); mocks.ReplayAll(); // Call - TestDelegate call = () => new FailureMechanismSectionsContext(failureMechanismMock, null); + TestDelegate call = () => new FailureMechanismSectionsContext(failureMechanism, null); // Assert Assert.Throws(call); Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneErosionFailureMechanismExtensionsTest.cs =================================================================== diff -u -r5ca8b004e3e6e0be00a45312867644a3b1b3454d -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneErosionFailureMechanismExtensionsTest.cs (.../DuneErosionFailureMechanismExtensionsTest.cs) (revision 5ca8b004e3e6e0be00a45312867644a3b1b3454d) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Data.Test/DuneErosionFailureMechanismExtensionsTest.cs (.../DuneErosionFailureMechanismExtensionsTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -54,7 +54,7 @@ }; var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); assessmentSection.Stub(a => a.GetFailureMechanisms()).Return(new[] { failureMechanism Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/PropertyInfos/DuneErosionFailureMechanismPropertyInfoTest.cs =================================================================== diff -u -rc48f16746209f799f93c6fc79a5202a9e3fd419f -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/PropertyInfos/DuneErosionFailureMechanismPropertyInfoTest.cs (.../DuneErosionFailureMechanismPropertyInfoTest.cs) (revision c48f16746209f799f93c6fc79a5202a9e3fd419f) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/PropertyInfos/DuneErosionFailureMechanismPropertyInfoTest.cs (.../DuneErosionFailureMechanismPropertyInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -53,11 +53,11 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new DuneErosionFailureMechanism(); - var context = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSectionMock); + var context = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSection); using (var plugin = new DuneErosionPlugin()) { Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneErosionFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -rf2f7d22ee59276f5df1f83fd409899bd895ea163 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneErosionFailureMechanismContextTreeNodeInfoTest.cs (.../DuneErosionFailureMechanismContextTreeNodeInfoTest.cs) (revision f2f7d22ee59276f5df1f83fd409899bd895ea163) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneErosionFailureMechanismContextTreeNodeInfoTest.cs (.../DuneErosionFailureMechanismContextTreeNodeInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -95,11 +95,11 @@ public void ChildNodeObjects_FailureMechanismIsRelevant_ReturnChildDataNodes() { // Setup - var assessmentSectionStub = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); mocksRepository.ReplayAll(); var failureMechanism = new DuneErosionFailureMechanism(); - var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSectionStub); + var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSection); // Call var children = info.ChildNodeObjects(failureMechanismContext).ToArray(); @@ -114,15 +114,15 @@ Assert.AreEqual(2, inputsFolder.Contents.Count); var failureMechanismSectionsContext = (FailureMechanismSectionsContext) inputsFolder.Contents[0]; Assert.AreSame(failureMechanism, failureMechanismSectionsContext.WrappedData); - Assert.AreSame(assessmentSectionStub, failureMechanismSectionsContext.ParentAssessmentSection); + Assert.AreSame(assessmentSection, failureMechanismSectionsContext.ParentAssessmentSection); var inputComment = (Comment) inputsFolder.Contents[1]; Assert.AreSame(failureMechanism.InputComments, inputComment); var hydraulicBoundaryLocationsContext = (DuneLocationsContext) children[1]; Assert.AreSame(failureMechanism.DuneLocations, hydraulicBoundaryLocationsContext.WrappedData); Assert.AreSame(failureMechanism, hydraulicBoundaryLocationsContext.FailureMechanism); - Assert.AreSame(assessmentSectionStub, hydraulicBoundaryLocationsContext.AssessmentSection); + Assert.AreSame(assessmentSection, hydraulicBoundaryLocationsContext.AssessmentSection); var outputsFolder = (CategoryTreeFolder) children[2]; Assert.AreEqual("Oordeel", outputsFolder.Name); @@ -142,14 +142,14 @@ public void ChildNodeObjects_FailureMechanismIsNotRelevant_ReturnOnlyFailureMechanismNotRelevantComments() { // Setup - var assessmentSectionStub = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); mocksRepository.ReplayAll(); var failureMechanism = new DuneErosionFailureMechanism { IsRelevant = false }; - var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSectionStub); + var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSection); // Call var children = info.ChildNodeObjects(failureMechanismContext).ToArray(); @@ -165,8 +165,8 @@ { // Setup var failureMechanism = new DuneErosionFailureMechanism(); - var assessmentSectionMock = mocksRepository.Stub(); - var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSectionMock); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSection); var guiMock = mocksRepository.StrictMock(); var menuBuilderMock = mocksRepository.StrictMock(); @@ -206,8 +206,8 @@ { IsRelevant = false }; - var assessmentSectionMock = mocksRepository.Stub(); - var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSectionMock); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSection); var guiMock = mocksRepository.StrictMock(); var menuBuilderMock = mocksRepository.StrictMock(); @@ -241,9 +241,9 @@ // Setup using (var treeView = new TreeViewControl()) { - var assessmentSectionMock = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); var failureMechanism = new DuneErosionFailureMechanism(); - var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); @@ -255,7 +255,7 @@ plugin.Gui = guiMock; // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSectionMock, treeView)) + using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSection, treeView)) { // Assert Assert.AreEqual(8, menu.Items.Count); @@ -274,12 +274,12 @@ // Setup using (var treeView = new TreeViewControl()) { - var assessmentSectionMock = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); var failureMechanism = new DuneErosionFailureMechanism { IsRelevant = false }; - var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); @@ -291,7 +291,7 @@ plugin.Gui = guiMock; // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSectionMock, treeView)) + using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSection, treeView)) { // Assert Assert.AreEqual(4, menu.Items.Count); @@ -309,8 +309,8 @@ { // Setup var failureMechanism = new DuneErosionFailureMechanism(); - var assessmentSectionStub = mocksRepository.Stub(); - var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSectionStub); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSection); var viewCommandsMock = mocksRepository.StrictMock(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); @@ -344,8 +344,8 @@ { IsRelevant = false }; - var assessmentSectionStub = mocksRepository.Stub(); - var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSectionStub); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSection); var viewCommandsMock = mocksRepository.StrictMock(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismResultViewInfoTest.cs =================================================================== diff -u -rb9a59dd5f30c8de46d0cabb4e1609c09176a4246 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismResultViewInfoTest.cs (.../DuneErosionFailureMechanismResultViewInfoTest.cs) (revision b9a59dd5f30c8de46d0cabb4e1609c09176a4246) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismResultViewInfoTest.cs (.../DuneErosionFailureMechanismResultViewInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -139,10 +139,10 @@ public void CloseForData_AssessmentSectionRemovedWithoutFailureMechanism_ReturnsFalse() { // Setup - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var failureMechanism = new DuneErosionFailureMechanism(); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); mocks.ReplayAll(); @@ -151,7 +151,7 @@ view.Data = failureMechanism.SectionResults; // Call - var closeForData = info.CloseForData(view, assessmentSectionMock); + var closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsFalse(closeForData); @@ -163,23 +163,23 @@ public void CloseForData_ViewNotCorrespondingToRemovedAssessmentSection_ReturnsFalse() { // Setup - var assessmentSectionMock = mocks.StrictMock(); - var failureMechanismMock = mocks.Stub("N", "C"); + var assessmentSection = mocks.Stub(); + var failureMechanism = new DuneErosionFailureMechanism(); + var otherFailureMechanism = mocks.Stub("N", "C"); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[] + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[] { - failureMechanismMock + otherFailureMechanism }); mocks.ReplayAll(); using (var view = new DuneErosionFailureMechanismResultView()) { - var failureMechanism = new DuneErosionFailureMechanism(); view.Data = failureMechanism.SectionResults; // Call - var closeForData = info.CloseForData(view, assessmentSectionMock); + var closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsFalse(closeForData); @@ -191,13 +191,13 @@ public void CloseForData_ViewCorrespondingToRemovedAssessmentSection_ReturnsTrue() { // Setup - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var failureMechanism = new DuneErosionFailureMechanism(); - var failureMechanismStub = mocks.Stub("N", "C"); + var otherFailureMechanism = mocks.Stub("N", "C"); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[] + assessmentSection.Expect(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[] { - failureMechanismStub, + otherFailureMechanism, failureMechanism }); @@ -208,7 +208,7 @@ view.Data = failureMechanism.SectionResults; // Call - var closeForData = info.CloseForData(view, assessmentSectionMock); + var closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsTrue(closeForData); Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismViewInfoTest.cs =================================================================== diff -u -rb9a59dd5f30c8de46d0cabb4e1609c09176a4246 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismViewInfoTest.cs (.../DuneErosionFailureMechanismViewInfoTest.cs) (revision b9a59dd5f30c8de46d0cabb4e1609c09176a4246) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismViewInfoTest.cs (.../DuneErosionFailureMechanismViewInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -87,20 +87,20 @@ public void CloseForData_ViewNotCorrespondingToRemovedAssessmentSection_ReturnsFalse() { // Setup - var assessmentSectionStub = mocks.Stub(); - var otherAssessmentSectionMock = mocks.Stub(); + var assessmentSection = mocks.Stub(); + var otherAssessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new DuneErosionFailureMechanism(); - var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSectionStub); + var failureMechanismContext = new DuneErosionFailureMechanismContext(failureMechanism, assessmentSection); using (var view = new DuneErosionFailureMechanismView { Data = failureMechanismContext }) { // Call - bool closeForData = info.CloseForData(view, otherAssessmentSectionMock); + bool closeForData = info.CloseForData(view, otherAssessmentSection); // Assert Assert.IsFalse(closeForData); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationContextTest.cs =================================================================== diff -u -r04012135e8adf6a03ce2928e047603435c9a186f -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationContextTest.cs (.../GrassCoverErosionInwardsCalculationContextTest.cs) (revision 04012135e8adf6a03ce2928e047603435c9a186f) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationContextTest.cs (.../GrassCoverErosionInwardsCalculationContextTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -36,21 +36,21 @@ { // Setup var mocksRepository = new MockRepository(); - var assessmentSectionMock = mocksRepository.StrictMock(); + var assessmentSection = mocksRepository.Stub(); mocksRepository.ReplayAll(); var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call - var context = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var context = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf>(context); Assert.IsInstanceOf>(context); Assert.AreSame(calculation, context.WrappedData); Assert.AreSame(failureMechanism, context.FailureMechanism); - Assert.AreSame(assessmentSectionMock, context.AssessmentSection); + Assert.AreSame(assessmentSection, context.AssessmentSection); mocksRepository.VerifyAll(); } } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationGroupContextTest.cs =================================================================== diff -u -r7d790a82bda0347f47961162de614bacfa8e288c -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationGroupContextTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTest.cs) (revision 7d790a82bda0347f47961162de614bacfa8e288c) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsCalculationGroupContextTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -37,21 +37,21 @@ { // Setup var mockRepository = new MockRepository(); - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); var calculationGroup = new CalculationGroup(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call - var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(calculationGroup, failureMechanism, assessmentSectionMock); + var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(calculationGroup, failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf>(groupContext); Assert.IsInstanceOf>(groupContext); Assert.AreSame(calculationGroup, groupContext.WrappedData); Assert.AreSame(failureMechanism, groupContext.FailureMechanism); - Assert.AreSame(assessmentSectionMock, groupContext.AssessmentSection); + Assert.AreSame(assessmentSection, groupContext.AssessmentSection); Assert.AreSame(failureMechanism.DikeProfiles, groupContext.AvailableDikeProfiles); mockRepository.VerifyAll(); } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContextTest.cs =================================================================== diff -u -re775448bfb8290e43d62340a53a08723bbc035c6 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContextTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTest.cs) (revision e775448bfb8290e43d62340a53a08723bbc035c6) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PresentationObjects/GrassCoverErosionInwardsFailureMechanismContextTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -37,17 +37,17 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call - var context = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var context = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf>(context); - Assert.AreSame(assessmentSectionMock, context.Parent); + Assert.AreSame(assessmentSection, context.Parent); Assert.AreSame(failureMechanism, context.WrappedData); mocks.VerifyAll(); } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs =================================================================== diff -u -r1188217e2d4f0c433987018e1cd6eb85af9488c1 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs) (revision 1188217e2d4f0c433987018e1cd6eb85af9488c1) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertiesTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -91,14 +91,14 @@ public void Constructor_ExpectedValues() { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); var handler = mockRepository.Stub>(); mockRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var properties = new GrassCoverErosionInwardsFailureMechanismContextProperties( - new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock), + new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection), handler); // Assert @@ -125,15 +125,15 @@ public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); var handler = mockRepository.Stub>(); mockRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call var properties = new GrassCoverErosionInwardsFailureMechanismContextProperties( - new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock), + new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection), handler); // Assert @@ -206,7 +206,7 @@ public void LengthEffect_SetInvalidValue_ThrowsThrowsArgumentOutOfRangeExceptionNoNotifcations(int newLengthEffect) { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); var observableMock = mockRepository.StrictMock(); mockRepository.ReplayAll(); @@ -220,7 +220,7 @@ }); var properties = new GrassCoverErosionInwardsFailureMechanismContextProperties( - new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock), + new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection), changeHandler); // Call @@ -242,7 +242,7 @@ var observableMock = mockRepository.StrictMock(); observableMock.Expect(o => o.NotifyObservers()); - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); @@ -256,7 +256,7 @@ }); var properties = new GrassCoverErosionInwardsFailureMechanismContextProperties( - new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock), + new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection), changeHandler); // Call Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs =================================================================== diff -u -r1244b03d31cacce72a6e662260912f73d405e7b4 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs) (revision 1244b03d31cacce72a6e662260912f73d405e7b4) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -63,7 +63,7 @@ public void Data_SetNewInputContextInstance_ReturnCorrectPropertyValues() { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -72,7 +72,7 @@ var properties = new GrassCoverErosionInwardsInputContextDikeGeometryProperties(); // Call - properties.Data = new GrassCoverErosionInwardsInputContext(input, calculation, failureMechanism, assessmentSectionMock); + properties.Data = new GrassCoverErosionInwardsInputContext(input, calculation, failureMechanism, assessmentSection); // Assert CollectionAssert.IsEmpty(properties.Coordinates); @@ -84,7 +84,7 @@ public void Data_SetInputContextInstanceWithData_ReturnCorrectPropertyValues() { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -106,7 +106,7 @@ var properties = new GrassCoverErosionInwardsInputContextDikeGeometryProperties(); // Call - properties.Data = new GrassCoverErosionInwardsInputContext(calculation.InputParameters, calculation, failureMechanism, assessmentSectionMock); + properties.Data = new GrassCoverErosionInwardsInputContext(calculation.InputParameters, calculation, failureMechanism, assessmentSection); // Assert var expectedCoordinates = new[] @@ -128,7 +128,7 @@ public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -138,7 +138,7 @@ // Call var properties = new GrassCoverErosionInwardsInputContextDikeGeometryProperties { - Data = new GrassCoverErosionInwardsInputContext(input, calculation, failureMechanism, assessmentSectionMock) + Data = new GrassCoverErosionInwardsInputContext(input, calculation, failureMechanism, assessmentSection) }; // Assert Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextPropertiesTest.cs =================================================================== diff -u -reeb27f17b6f6f712bb8586ce1b93643d2e709d4e -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextPropertiesTest.cs) (revision eeb27f17b6f6f712bb8586ce1b93643d2e709d4e) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextPropertiesTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -83,16 +83,16 @@ public void Data_SetNewInputContextInstance_ReturnCorrectPropertyValues() { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); - var failureMechanismMock = mockRepository.StrictMock(); - var calculationMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); + var failureMechanism = mockRepository.Stub(); + var calculation = mockRepository.Stub(); mockRepository.ReplayAll(); var input = new GrassCoverErosionInwardsInput { DikeHeightCalculationType = DikeHeightCalculationType.NoCalculation }; - var inputContext = new GrassCoverErosionInwardsInputContext(input, calculationMock, failureMechanismMock, assessmentSectionMock); + var inputContext = new GrassCoverErosionInwardsInputContext(input, calculation, failureMechanism, assessmentSection); // Call var properties = new GrassCoverErosionInwardsInputContextProperties @@ -123,17 +123,17 @@ public void Data_SetNewInputContextInstanceWithDikeProfile_ReturnCorrectPropertyValues() { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); - var failureMechanismMock = mockRepository.StrictMock(); - var calculationMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); + var failureMechanism = mockRepository.Stub(); + var calculation = mockRepository.Stub(); mockRepository.ReplayAll(); var input = new GrassCoverErosionInwardsInput { DikeProfile = new TestDikeProfile(new Point2D(12.34, 56.78)), HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "", 0, 0) }; - var inputContext = new GrassCoverErosionInwardsInputContext(input, calculationMock, failureMechanismMock, assessmentSectionMock); + var inputContext = new GrassCoverErosionInwardsInputContext(input, calculation, failureMechanism, assessmentSection); // Call var properties = new GrassCoverErosionInwardsInputContextProperties @@ -162,7 +162,7 @@ public void SetProperties_IndividualProperties_UpdateDataAndNotifyObservers() { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); var input = new GrassCoverErosionInwardsInput(); @@ -172,7 +172,7 @@ input, new GrassCoverErosionInwardsCalculation(), new GrassCoverErosionInwardsFailureMechanism(), - assessmentSectionMock) + assessmentSection) }; DikeProfile newDikeProfile = new TestDikeProfile(); @@ -598,7 +598,7 @@ public void Constructor_Always_PropertiesHaveExpectedAttributesValues(bool withDikeProfile) { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -613,7 +613,7 @@ // Call var properties = new GrassCoverErosionInwardsInputContextProperties { - Data = new GrassCoverErosionInwardsInputContext(input, calculation, failureMechanism, assessmentSectionMock) + Data = new GrassCoverErosionInwardsInputContext(input, calculation, failureMechanism, assessmentSection) }; // Assert Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/UITypeEditors/GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs =================================================================== diff -u -rc4972d4aec336f991ac1b4ab3dcd56161c238516 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/UITypeEditors/GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs (.../GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs) (revision c4972d4aec336f991ac1b4ab3dcd56161c238516) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/UITypeEditors/GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs (.../GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -60,11 +60,11 @@ var grassCoverErosionInwardsInput = new GrassCoverErosionInwardsInput(); var grassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation(); - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); var inputContext = new GrassCoverErosionInwardsInputContext(grassCoverErosionInwardsInput, grassCoverErosionInwardsCalculation, failureMechanism, - assessmentSectionMock); + assessmentSection); var properties = new GrassCoverErosionInwardsInputContextProperties { @@ -110,11 +110,11 @@ }; var grassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation(); - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); var inputContext = new GrassCoverErosionInwardsInputContext(grassCoverErosionInwardsInput, grassCoverErosionInwardsCalculation, failureMechanism, - assessmentSectionMock); + assessmentSection); var properties = new GrassCoverErosionInwardsInputContextProperties { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsInputContextPropertiesIntegrationTest.cs =================================================================== diff -u -rc4972d4aec336f991ac1b4ab3dcd56161c238516 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsInputContextPropertiesIntegrationTest.cs (.../GrassCoverErosionInwardsInputContextPropertiesIntegrationTest.cs) (revision c4972d4aec336f991ac1b4ab3dcd56161c238516) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsInputContextPropertiesIntegrationTest.cs (.../GrassCoverErosionInwardsInputContextPropertiesIntegrationTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -49,7 +49,7 @@ public void DikeProfile_CalculationDikeProfileSetToOtherSection_SecondSectionResultCalculationSetFirstSectionResultCalculationNull() { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); DikeProfile dikeProfile1 = new TestDikeProfile(new Point2D(0.51, 0.51)); @@ -82,7 +82,7 @@ var sectionResults = failureMechanism.SectionResults.ToArray(); sectionResults[0].Calculation = calculation; - var inputContext = new GrassCoverErosionInwardsInputContext(calculation.InputParameters, calculation, failureMechanism, assessmentSectionMock); + var inputContext = new GrassCoverErosionInwardsInputContext(calculation.InputParameters, calculation, failureMechanism, assessmentSection); var properties = new GrassCoverErosionInwardsInputContextProperties { @@ -103,7 +103,7 @@ public void DikeProfile_CalculationDikeProfileSetToOtherSection_SecondSectionResultCalculationUnchangedFirstSectionResultCalculationNull() { // Setup - var assessmentSectionMock = mockRepository.StrictMock(); + var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); DikeProfile dikeProfile1 = new TestDikeProfile(new Point2D(0.51, 0.51)); @@ -147,7 +147,7 @@ sectionResults[0].Calculation = calculation1; sectionResults[1].Calculation = calculation2; - var inputContext = new GrassCoverErosionInwardsInputContext(calculation1.InputParameters, calculation1, failureMechanism, assessmentSectionMock); + var inputContext = new GrassCoverErosionInwardsInputContext(calculation1.InputParameters, calculation1, failureMechanism, assessmentSection); var properties = new GrassCoverErosionInwardsInputContextProperties { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs =================================================================== diff -u -rc48f16746209f799f93c6fc79a5202a9e3fd419f -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs) (revision c48f16746209f799f93c6fc79a5202a9e3fd419f) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextPropertyInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -62,7 +62,7 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsInputContextPropertyInfoTest.cs =================================================================== diff -u -rc48f16746209f799f93c6fc79a5202a9e3fd419f -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsInputContextPropertyInfoTest.cs (.../GrassCoverErosionInwardsInputContextPropertyInfoTest.cs) (revision c48f16746209f799f93c6fc79a5202a9e3fd419f) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/PropertyInfos/GrassCoverErosionInwardsInputContextPropertyInfoTest.cs (.../GrassCoverErosionInwardsInputContextPropertyInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -62,7 +62,7 @@ { // Setup var mocks = new MockRepository(); - var assessmentSection = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var calculation = new GrassCoverErosionInwardsCalculation(); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r0e6d67805775b5b8a587156ba1d647ad35bb7441 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 0e6d67805775b5b8a587156ba1d647ad35bb7441) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -115,12 +115,12 @@ [Test] public void ChildNodeObjects_CalculationWithoutOutput_ReturnCollectionWithEmptyOutputObject() { - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); // Call var children = info.ChildNodeObjects(calculationContext).ToArray(); @@ -142,7 +142,7 @@ [Test] public void ChildNodeObjects_CalculationWithOutput_ReturnCollectionWithOutputObject() { - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var calculation = new GrassCoverErosionInwardsCalculation @@ -151,7 +151,7 @@ new TestDikeHeightAssessmentOutput(0.0)) }; var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); // Call var children = info.ChildNodeObjects(calculationContext).ToArray(); @@ -176,9 +176,9 @@ // Setup var guiMock = mocks.StrictMock(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var calculation = new GrassCoverErosionInwardsCalculation(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); var menuBuilderMock = mocks.Stub(); using (mocks.Ordered()) @@ -218,27 +218,27 @@ // Setup var guiMock = mocks.StrictMock(); var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var calculation = new GrassCoverErosionInwardsCalculation(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); using (var treeViewControl = new TreeViewControl()) { guiMock.Expect(cmp => cmp.Get(nodeData, treeViewControl)).Return(menuBuilder); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "random" - }); + }; mocks.ReplayAll(); plugin.Gui = guiMock; // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSectionMock, treeViewControl)) + using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) { // Assert Assert.AreEqual(11, menu.Items.Count); @@ -268,10 +268,10 @@ // Setup var guiMock = mocks.StrictMock(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -300,12 +300,12 @@ // Setup var guiMock = mocks.StrictMock(); - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase()); + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -337,18 +337,16 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -379,18 +377,16 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -418,10 +414,10 @@ // Setup var guiMock = mocks.StrictMock(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -450,12 +446,12 @@ // Setup var guiMock = mocks.StrictMock(); - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase()); + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -487,18 +483,16 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -529,18 +523,16 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); - var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -583,10 +575,10 @@ }; hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - var assessmentSectionStub = mocks.Stub(); - assessmentSectionStub.Stub(a => a.Id).Return(string.Empty); - assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; - assessmentSectionStub.Stub(a => a.FailureMechanismContribution).Return(new FailureMechanismContribution(Enumerable.Empty(), 1, 1)); + var assessmentSection = mocks.Stub(); + assessmentSection.Stub(a => a.Id).Return(string.Empty); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + assessmentSection.Stub(a => a.FailureMechanismContribution).Return(new FailureMechanismContribution(Enumerable.Empty(), 1, 1)); var initialOutput = new GrassCoverErosionInwardsOutput(0, true, new ProbabilityAssessmentOutput(double.NaN, double.NaN, double.NaN, double.NaN, double.NaN), @@ -601,7 +593,7 @@ } }; - var calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -662,8 +654,8 @@ }; hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - var assessmentSectionStub = mocks.Stub(); - assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; var calculation = new GrassCoverErosionInwardsCalculation { @@ -674,7 +666,7 @@ } }; - var calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSectionStub); + var calculationContext = new GrassCoverErosionInwardsCalculationContext(calculation, failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -710,13 +702,13 @@ var elementToBeRemoved = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var observerMock = mocks.StrictMock(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var calculationContext = new GrassCoverErosionInwardsCalculationContext(elementToBeRemoved, failureMechanism, - assessmentSectionMock); + assessmentSection); var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); observerMock.Expect(o => o.UpdateObserver()); @@ -742,7 +734,7 @@ public void OnNodeRemoved_NodeRemoved_RemoveCalculationFromFailureMechanismSectionResults() { // Setup - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var group = new CalculationGroup(); @@ -768,10 +760,10 @@ var calculationContext = new GrassCoverErosionInwardsCalculationContext(elementToBeRemoved, failureMechanism, - assessmentSectionMock); + assessmentSection); var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); group.Children.Add(elementToBeRemoved); group.Children.Add(new GrassCoverErosionInwardsCalculation()); @@ -797,13 +789,13 @@ var group = new CalculationGroup(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var elementToBeRemoved = new GrassCoverErosionInwardsCalculation(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var calculationContext = new GrassCoverErosionInwardsCalculationContext(elementToBeRemoved, failureMechanism, - assessmentSectionStub); + assessmentSection); var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionStub); + assessmentSection); mocks.ReplayAll(); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r0e6d67805775b5b8a587156ba1d647ad35bb7441 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision 0e6d67805775b5b8a587156ba1d647ad35bb7441) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -121,12 +121,12 @@ // Setup var group = new CalculationGroup(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); // Call var children = info.ChildNodeObjects(groupContext); @@ -139,7 +139,7 @@ public void ChildNodeObjects_GroupWithMixedContents_ReturnChildren() { // Setup - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var calculationItemMock = mocks.StrictMock(); mocks.ReplayAll(); @@ -154,7 +154,7 @@ var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); // Call var children = info.ChildNodeObjects(groupContext).ToArray(); @@ -164,11 +164,11 @@ var calculationGroupContext = (GrassCoverErosionInwardsCalculationGroupContext) children[0]; Assert.AreSame(childGroup, calculationGroupContext.WrappedData); Assert.AreSame(failureMechanism, calculationGroupContext.FailureMechanism); - Assert.AreSame(assessmentSectionMock, calculationGroupContext.AssessmentSection); + Assert.AreSame(assessmentSection, calculationGroupContext.AssessmentSection); Assert.AreSame(calculationItemMock, children[1]); var calculationContext = (GrassCoverErosionInwardsCalculationContext) children[2]; Assert.AreSame(childCalculation, calculationContext.WrappedData); - Assert.AreSame(assessmentSectionMock, calculationContext.AssessmentSection); + Assert.AreSame(assessmentSection, calculationContext.AssessmentSection); } [Test] @@ -177,10 +177,10 @@ // Setup var group = new CalculationGroup(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var menuBuilderMock = mocks.StrictMock(); @@ -224,10 +224,10 @@ // Setup var group = new CalculationGroup(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); using (var treeViewControl = new TreeViewControl()) { var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); @@ -277,13 +277,13 @@ var group = new CalculationGroup(); var parentGroup = new CalculationGroup(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var parentGroupContext = new GrassCoverErosionInwardsCalculationGroupContext(parentGroup, failureMechanism, - assessmentSectionMock); + assessmentSection); using (var treeViewControl = new TreeViewControl()) { var menuBuilderMock = mocks.StrictMock(); @@ -325,7 +325,7 @@ var group = new CalculationGroup(); var parentGroup = new CalculationGroup(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSection = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, assessmentSection); @@ -389,12 +389,10 @@ failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(null); - + var assessmentSection = mocks.Stub(); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var applicationFeatureCommandHandlerStub = mocks.Stub(); var importHandlerMock = mocks.StrictMock(); @@ -442,12 +440,12 @@ failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase()); + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var applicationFeatureCommandHandlerStub = mocks.Stub(); var importHandlerMock = mocks.StrictMock(); @@ -493,22 +491,20 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); + + failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); + + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - - failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -545,22 +541,20 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); + + failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); + + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); - - failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -597,12 +591,10 @@ var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(null); - + var assessmentSection = mocks.Stub(); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var applicationFeatureCommandHandlerStub = mocks.Stub(); var importHandlerMock = mocks.StrictMock(); @@ -649,12 +641,12 @@ var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase()); + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var applicationFeatureCommandHandlerStub = mocks.Stub(); var importHandlerMock = mocks.StrictMock(); @@ -701,21 +693,19 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); + + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -752,21 +742,19 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); + failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); + + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); - failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -793,13 +781,10 @@ { // Setup var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(null); - + var assessmentSection = mocks.Stub(); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(failureMechanism.CalculationsGroup, failureMechanism, - assessmentSectionMock); + assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -829,12 +814,11 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.DikeProfiles.Add(new TestDikeProfile()); - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(null); + var assessmentSection = mocks.Stub(); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(failureMechanism.CalculationsGroup, failureMechanism, - assessmentSectionMock); + assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -888,12 +872,12 @@ var hydraulicBoundaryDatabaseStub = mocks.Stub(); hydraulicBoundaryDatabaseStub.FilePath = validFilePath; - var assessmentSectionStub = mocks.Stub(); - assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(failureMechanism.CalculationsGroup, failureMechanism, - assessmentSectionStub); + assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -955,15 +939,15 @@ var hydraulicBoundaryDatabaseStub = mocks.Stub(); hydraulicBoundaryDatabaseStub.FilePath = validFilePath; - var assessmentSectionStub = mocks.Stub(); - assessmentSectionStub.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; - assessmentSectionStub.Stub(a => a.Id).Return(string.Empty); - assessmentSectionStub.Stub(a => a.FailureMechanismContribution) + var assessmentSection = mocks.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; + assessmentSection.Stub(a => a.Id).Return(string.Empty); + assessmentSection.Stub(a => a.FailureMechanismContribution) .Return(new FailureMechanismContribution(Enumerable.Empty(), 1, 1)); var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(failureMechanism.CalculationsGroup, failureMechanism, - assessmentSectionStub); + assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -1014,10 +998,10 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var group = new CalculationGroup(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var calculationGroup = new CalculationGroup { Name = "Nieuwe map" @@ -1060,10 +1044,10 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var group = new CalculationGroup(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionStub); + assessmentSection); var calculationItem = new GrassCoverErosionInwardsCalculation { Name = "Nieuwe berekening" @@ -1105,7 +1089,7 @@ // Given using (var treeViewControl = new TreeViewControl()) { - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); DikeProfile dikeProfile1 = new TestDikeProfile("Dike profile 1"); DikeProfile dikeProfile2 = new TestDikeProfile("Dike profile 2"); @@ -1121,7 +1105,7 @@ var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(failureMechanism.CalculationsGroup, failureMechanism, - assessmentSectionMock); + assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var mainWindow = mocks.Stub(); @@ -1163,7 +1147,7 @@ // Given using (var treeViewControl = new TreeViewControl()) { - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); DikeProfile dikeProfile1 = new TestDikeProfile("Dike profile 1"); DikeProfile dikeProfile2 = new TestDikeProfile("Dike profile 2"); @@ -1179,7 +1163,7 @@ var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(failureMechanism.CalculationsGroup, failureMechanism, - assessmentSectionMock); + assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var mainWindow = mocks.Stub(); @@ -1219,7 +1203,7 @@ // Given using (var treeViewControl = new TreeViewControl()) { - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); const string existingCalculationName = "Dike profile"; DikeProfile dikeProfile = new TestDikeProfile(existingCalculationName); @@ -1244,7 +1228,7 @@ var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(failureMechanism.CalculationsGroup, failureMechanism, - assessmentSectionStub); + assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var mainWindow = mocks.Stub(); @@ -1288,15 +1272,15 @@ // Setup var observerMock = mocks.StrictMock(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var group = new CalculationGroup(); var parentGroup = new CalculationGroup(); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var parentNodeData = new GrassCoverErosionInwardsCalculationGroupContext(parentGroup, failureMechanism, - assessmentSectionMock); + assessmentSection); observerMock.Expect(o => o.UpdateObserver()); @@ -1320,16 +1304,16 @@ { // Setup var observerMock = mocks.StrictMock(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var group = new CalculationGroup(); var parentGroup = new CalculationGroup(); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionMock); + assessmentSection); var parentNodeData = new GrassCoverErosionInwardsCalculationGroupContext(parentGroup, failureMechanism, - assessmentSectionMock); + assessmentSection); var calculation = new GrassCoverErosionInwardsCalculation(); observerMock.Expect(o => o.UpdateObserver()); @@ -1355,15 +1339,15 @@ { // Setup var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionStub = mocks.Stub(); + var assessmentSection = mocks.Stub(); var group = new CalculationGroup(); var parentGroup = new CalculationGroup(); var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, failureMechanism, - assessmentSectionStub); + assessmentSection); var parentNodeData = new GrassCoverErosionInwardsCalculationGroupContext(parentGroup, failureMechanism, - assessmentSectionStub); + assessmentSection); mocks.ReplayAll(); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -r0e6d67805775b5b8a587156ba1d647ad35bb7441 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 0e6d67805775b5b8a587156ba1d647ad35bb7441) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -102,11 +102,11 @@ public void ChildNodeObjects_FailureMechanismIsRelevant_ReturnChildDataNodes() { // Setup - var assessmentSectionMock = mocksRepository.StrictMock(); + var assessmentSection = mocksRepository.Stub(); mocksRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); // Call var children = info.ChildNodeObjects(failureMechanismContext).ToArray(); @@ -121,12 +121,12 @@ Assert.AreEqual(3, inputsFolder.Contents.Count); var failureMechanismSectionsContext = (FailureMechanismSectionsContext) inputsFolder.Contents[0]; Assert.AreSame(failureMechanism, failureMechanismSectionsContext.WrappedData); - Assert.AreSame(assessmentSectionMock, failureMechanismSectionsContext.ParentAssessmentSection); + Assert.AreSame(assessmentSection, failureMechanismSectionsContext.ParentAssessmentSection); var dikeProfilesContext = (DikeProfilesContext) inputsFolder.Contents[1]; Assert.AreSame(failureMechanism.DikeProfiles, dikeProfilesContext.WrappedData); Assert.AreSame(failureMechanism, dikeProfilesContext.ParentFailureMechanism); - Assert.AreSame(assessmentSectionMock, dikeProfilesContext.ParentAssessmentSection); + Assert.AreSame(assessmentSection, dikeProfilesContext.ParentAssessmentSection); var inputComment = (Comment) inputsFolder.Contents[2]; Assert.AreSame(failureMechanism.InputComments, inputComment); @@ -157,14 +157,14 @@ public void ChildNodeObjects_FailureMechanismIsNotRelevant_ReturnOnlyFailureMechanismNotRelevantComments() { // Setup - var assessmentSectionMock = mocksRepository.StrictMock(); + var assessmentSection = mocksRepository.Stub(); mocksRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism { IsRelevant = false }; - var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); // Call var children = info.ChildNodeObjects(failureMechanismContext).ToArray(); @@ -180,8 +180,8 @@ { // Setup var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionMock = mocksRepository.StrictMock(); - var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var guiMock = mocksRepository.StrictMock(); var menuBuilderMock = mocksRepository.StrictMock(); @@ -226,8 +226,8 @@ { IsRelevant = false }; - var assessmentSectionMock = mocksRepository.StrictMock(); - var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var guiMock = mocksRepository.StrictMock(); var menuBuilderMock = mocksRepository.StrictMock(); @@ -261,9 +261,9 @@ // Setup using (var treeView = new TreeViewControl()) { - var assessmentSectionMock = mocksRepository.StrictMock(); + var assessmentSection = mocksRepository.Stub(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); @@ -276,7 +276,7 @@ plugin.Gui = guiMock; // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSectionMock, treeView)) + using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSection, treeView)) { // Assert Assert.AreEqual(13, menu.Items.Count); @@ -313,12 +313,12 @@ // Setup using (var treeView = new TreeViewControl()) { - var assessmentSectionMock = mocksRepository.StrictMock(); + var assessmentSection = mocksRepository.Stub(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism { IsRelevant = false }; - var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); @@ -331,7 +331,7 @@ plugin.Gui = guiMock; // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSectionMock, treeView)) + using (ContextMenuStrip menu = info.ContextMenuStrip(failureMechanismContext, assessmentSection, treeView)) { // Assert Assert.AreEqual(4, menu.Items.Count); @@ -349,8 +349,8 @@ { // Setup var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var assessmentSectionStub = mocksRepository.Stub(); - var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionStub); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var viewCommandsMock = mocksRepository.StrictMock(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); @@ -385,8 +385,8 @@ { IsRelevant = false }; - var assessmentSectionStub = mocksRepository.Stub(); - var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionStub); + var assessmentSection = mocksRepository.Stub(); + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var viewCommandsMock = mocksRepository.StrictMock(); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var guiMock = mocksRepository.StrictMock(); @@ -421,9 +421,9 @@ var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSectionMock = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); - var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -455,10 +455,10 @@ var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSectionMock = mocksRepository.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase()); + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -493,16 +493,14 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var assessmentSectionMock = mocksRepository.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - - var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -536,16 +534,14 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var assessmentSectionMock = mocksRepository.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - - var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -576,9 +572,9 @@ var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSectionMock = mocksRepository.Stub(); + var assessmentSection = mocksRepository.Stub(); - var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -610,10 +606,10 @@ var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation()); - var assessmentSectionMock = mocksRepository.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase()); + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -648,16 +644,14 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var assessmentSectionMock = mocksRepository.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - - var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -691,16 +685,14 @@ string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { FilePath = validFilePath, Version = "1.0" }; - var assessmentSectionMock = mocksRepository.StrictMock(); - assessmentSectionMock.Stub(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase); - - var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var nodeData = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -756,12 +748,12 @@ var hydraulicBoundaryDatabaseStub = mocksRepository.Stub(); hydraulicBoundaryDatabaseStub.FilePath = validFilePath; - var assessmentSectionMock = mocksRepository.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; - assessmentSectionMock.Stub(a => a.Id).Return(string.Empty); - assessmentSectionMock.Stub(a => a.FailureMechanismContribution) + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; + assessmentSection.Stub(a => a.Id).Return(string.Empty); + assessmentSection.Stub(a => a.FailureMechanismContribution) .Return(new FailureMechanismContribution(Enumerable.Empty(), 1, 1)); - var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { @@ -836,9 +828,9 @@ var hydraulicBoundaryDatabaseStub = mocksRepository.Stub(); hydraulicBoundaryDatabaseStub.FilePath = validFilePath; - var assessmentSectionMock = mocksRepository.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; - var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabaseStub; + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); using (var treeViewControl = new TreeViewControl()) { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsInputContextTreeNodeInfoTest.cs =================================================================== diff -u -rf2f7d22ee59276f5df1f83fd409899bd895ea163 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsInputContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsInputContextTreeNodeInfoTest.cs) (revision f2f7d22ee59276f5df1f83fd409899bd895ea163) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsInputContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsInputContextTreeNodeInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -86,12 +86,11 @@ public void Text_Always_ReturnsTextFromResource() { // Setup - var assessmentSectionMock = mocksRepository.StrictMock(); var grassCoverErosionInwardsInputContext = new GrassCoverErosionInwardsInputContext( - mocksRepository.StrictMock(), - mocksRepository.StrictMock(), + mocksRepository.Stub(), + mocksRepository.Stub(), new GrassCoverErosionInwardsFailureMechanism(), - assessmentSectionMock); + mocksRepository.Stub()); mocksRepository.ReplayAll(); @@ -106,12 +105,11 @@ public void Image_Always_ReturnsSetImage() { // Setup - var assessmentSectionMock = mocksRepository.StrictMock(); var grassCoverErosionInwardsInputContext = new GrassCoverErosionInwardsInputContext( - mocksRepository.StrictMock(), - mocksRepository.StrictMock(), + mocksRepository.Stub(), + mocksRepository.Stub(), new GrassCoverErosionInwardsFailureMechanism(), - assessmentSectionMock); + mocksRepository.Stub()); mocksRepository.ReplayAll(); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismResultViewInfoTest.cs =================================================================== diff -u -r0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismResultViewInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismResultViewInfoTest.cs) (revision 0efb28b7f5a708daa1cf9e8aeba6b8f84a3ebaf5) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismResultViewInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismResultViewInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -113,13 +113,13 @@ Data = failureMechanism.SectionResults }; - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); + var assessmentSection = mocks.Stub(); + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); mocks.ReplayAll(); // Call - var closeForData = info.CloseForData(view, assessmentSectionMock); + var closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsFalse(closeForData); @@ -131,23 +131,23 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var view = new GrassCoverErosionInwardsFailureMechanismResultView { Data = failureMechanism.SectionResults }; - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new[] + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new[] { new GrassCoverErosionInwardsFailureMechanism() }); mocks.ReplayAll(); // Call - var closeForData = info.CloseForData(view, assessmentSectionMock); + var closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsFalse(closeForData); @@ -159,14 +159,14 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var view = new GrassCoverErosionInwardsFailureMechanismResultView { Data = failureMechanism.SectionResults }; - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[] + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[] { new GrassCoverErosionInwardsFailureMechanism(), failureMechanism @@ -175,7 +175,7 @@ mocks.ReplayAll(); // Call - var closeForData = info.CloseForData(view, assessmentSectionMock); + var closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsTrue(closeForData); @@ -223,11 +223,11 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSectionMock); + var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, assessmentSection); var view = new GrassCoverErosionInwardsFailureMechanismResultView { @@ -247,7 +247,7 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -257,7 +257,7 @@ }; var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(new GrassCoverErosionInwardsFailureMechanism(), - assessmentSectionMock); + assessmentSection); // Call var closeForData = info.CloseForData(view, failureMechanismContext); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismViewInfoTest.cs =================================================================== diff -u -r8c1fffbb415e7c2470be6d3fa2971103777d418e -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismViewInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewInfoTest.cs) (revision 8c1fffbb415e7c2470be6d3fa2971103777d418e) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismViewInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -88,20 +88,20 @@ public void CloseForData_ViewNotCorrespondingToRemovedAssessmentSection_ReturnsFalse() { // Setup - var assessmentSectionStub = mocks.Stub(); - var otherAssessmentSectionMock = mocks.Stub(); + var assessmentSection = mocks.Stub(); + var otherAssessmentSection = mocks.Stub(); mocks.ReplayAll(); var grassCoverErosionInwardsFailureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var grassCoverErosionInwardsFailureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(grassCoverErosionInwardsFailureMechanism, assessmentSectionStub); + var grassCoverErosionInwardsFailureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(grassCoverErosionInwardsFailureMechanism, assessmentSection); using (var view = new GrassCoverErosionInwardsFailureMechanismView { Data = grassCoverErosionInwardsFailureMechanismContext }) { // Call - bool closeForData = info.CloseForData(view, otherAssessmentSectionMock); + bool closeForData = info.CloseForData(view, otherAssessmentSection); // Assert Assert.IsFalse(closeForData); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsInputViewInfoTest.cs =================================================================== diff -u -rce9e1d476f00cfb42ce2a8ab6c762baf5abfd97b -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsInputViewInfoTest.cs (.../GrassCoverErosionInwardsInputViewInfoTest.cs) (revision ce9e1d476f00cfb42ce2a8ab6c762baf5abfd97b) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsInputViewInfoTest.cs (.../GrassCoverErosionInwardsInputViewInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -83,7 +83,7 @@ public void GetViewData_Always_ReturnsWrappedCalculation() { // Setup - IAssessmentSection assessmentSection = mocks.StrictMock(); + IAssessmentSection assessmentSection = mocks.Stub(); mocks.ReplayAll(); GrassCoverErosionInwardsInput input = new GrassCoverErosionInwardsInput(); @@ -104,7 +104,7 @@ public void CloseForData_ViewCorrespondingToRemovedCalculationContext_ReturnsTrue() { // Setup - IAssessmentSection assessmentSection = mocks.StrictMock(); + IAssessmentSection assessmentSection = mocks.Stub(); mocks.ReplayAll(); GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation(); @@ -130,7 +130,7 @@ public void CloseForData_ViewNotCorrespondingToRemovedCalculationContext_ReturnsFalse() { // Setup - IAssessmentSection assessmentSection = mocks.StrictMock(); + IAssessmentSection assessmentSection = mocks.Stub(); mocks.ReplayAll(); GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation(); @@ -199,7 +199,7 @@ public void CloseForData_ViewCorrespondingWithRemovedCalculationGroupContext_ReturnsTrue() { // Setup - IAssessmentSection assessmentSection = mocks.StrictMock(); + IAssessmentSection assessmentSection = mocks.Stub(); mocks.ReplayAll(); GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation(); @@ -227,7 +227,7 @@ public void CloseForData_ViewNotCorrespondingWithRemovedCalculationGroupContext_ReturnsFalse() { // Setup - IAssessmentSection assessmentSection = mocks.StrictMock(); + IAssessmentSection assessmentSection = mocks.Stub(); mocks.ReplayAll(); GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation(); @@ -255,7 +255,7 @@ public void CloseForData_NestedViewCorrespondingWithRemovedParentCalculationGroupContext_ReturnsTrue() { // Setup - IAssessmentSection assessmentSection = mocks.StrictMock(); + IAssessmentSection assessmentSection = mocks.Stub(); mocks.ReplayAll(); GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation(); @@ -285,7 +285,7 @@ public void CloseForData_NestedViewNotCorrespondingWithRemovedParentCalculationGroupContext_ReturnsFalse() { // Setup - IAssessmentSection assessmentSection = mocks.StrictMock(); + IAssessmentSection assessmentSection = mocks.Stub(); mocks.ReplayAll(); GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation(); @@ -315,7 +315,7 @@ public void CloseForData_ViewCorrespondingToRemovedFailureMechanismContext_ReturnsTrue() { // Setup - IAssessmentSection assessmentSection = mocks.StrictMock(); + IAssessmentSection assessmentSection = mocks.Stub(); mocks.ReplayAll(); GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation(); @@ -342,7 +342,7 @@ public void CloseForData_ViewNotCorrespondingToRemovedFailureMechanismContext_ReturnsFalse() { // Setup - IAssessmentSection assessmentSection = mocks.StrictMock(); + IAssessmentSection assessmentSection = mocks.Stub(); mocks.ReplayAll(); GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation(); @@ -369,7 +369,7 @@ public void CloseForData_NestedViewCorrespondingToRemovedFailureMechanismContext_ReturnsTrue() { // Setup - IAssessmentSection assessmentSection = mocks.StrictMock(); + IAssessmentSection assessmentSection = mocks.Stub(); mocks.ReplayAll(); GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation(); @@ -399,7 +399,7 @@ public void CloseForData_NestedViewNotCorrespondingToRemovedFailureMechanismContext_ReturnsFalse() { // Setup - IAssessmentSection assessmentSection = mocks.StrictMock(); + IAssessmentSection assessmentSection = mocks.Stub(); mocks.ReplayAll(); GrassCoverErosionInwardsCalculation calculation = new GrassCoverErosionInwardsCalculation(); @@ -523,8 +523,8 @@ GrassCoverErosionInwardsFailureMechanism failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(calculation); - IAssessmentSection assessmentSection = mocks.StrictMock(); - assessmentSection.Expect(section => section.GetFailureMechanisms()).Return(new[] + IAssessmentSection assessmentSection = mocks.Stub(); + assessmentSection.Stub(section => section.GetFailureMechanisms()).Return(new[] { failureMechanism }); @@ -553,8 +553,8 @@ GrassCoverErosionInwardsFailureMechanism failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(calculation); - IAssessmentSection assessmentSection = mocks.StrictMock(); - assessmentSection.Expect(section => section.GetFailureMechanisms()).Return(new[] + IAssessmentSection assessmentSection = mocks.Stub(); + assessmentSection.Stub(section => section.GetFailureMechanisms()).Return(new[] { failureMechanism }); @@ -586,8 +586,8 @@ GrassCoverErosionInwardsFailureMechanism failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(calculationGroup); - IAssessmentSection assessmentSection = mocks.StrictMock(); - assessmentSection.Expect(section => section.GetFailureMechanisms()).Return(new[] + IAssessmentSection assessmentSection = mocks.Stub(); + assessmentSection.Stub(section => section.GetFailureMechanisms()).Return(new[] { failureMechanism }); @@ -619,8 +619,8 @@ GrassCoverErosionInwardsFailureMechanism failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(calculationGroup); - IAssessmentSection assessmentSection = mocks.StrictMock(); - assessmentSection.Expect(section => section.GetFailureMechanisms()).Return(new[] + IAssessmentSection assessmentSection = mocks.Stub(); + assessmentSection.Stub(section => section.GetFailureMechanisms()).Return(new[] { failureMechanism }); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsScenariosViewInfoTest.cs =================================================================== diff -u -r8c1fffbb415e7c2470be6d3fa2971103777d418e -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsScenariosViewInfoTest.cs (.../GrassCoverErosionInwardsScenariosViewInfoTest.cs) (revision 8c1fffbb415e7c2470be6d3fa2971103777d418e) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsScenariosViewInfoTest.cs (.../GrassCoverErosionInwardsScenariosViewInfoTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -226,8 +226,8 @@ public void CloseForData_AssessmentSectionRemovedWithoutGrassCoverErosionInwardsFailureMechanism_ReturnsFalse() { // Setup - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); + var assessmentSection = mocks.Stub(); + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); mocks.ReplayAll(); var view = new GrassCoverErosionInwardsScenariosView @@ -236,7 +236,7 @@ }; // Call - bool closeForData = info.CloseForData(view, assessmentSectionMock); + bool closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsFalse(closeForData); @@ -247,8 +247,8 @@ public void CloseForData_ViewNotCorrespondingToRemovedAssessmentSection_ReturnsFalse() { // Setup - var assessmentSectionMock = mocks.StrictMock(); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new[] + var assessmentSection = mocks.Stub(); + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new[] { new GrassCoverErosionInwardsFailureMechanism() }); @@ -261,7 +261,7 @@ }; // Call - bool closeForData = info.CloseForData(view, assessmentSectionMock); + bool closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsFalse(closeForData); @@ -272,9 +272,9 @@ public void CloseForData_ViewCorrespondingToRemovedAssessmentSection_ReturnsTrue() { // Setup - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - assessmentSectionMock.Expect(asm => asm.GetFailureMechanisms()).Return(new[] + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new[] { failureMechanism }); @@ -287,7 +287,7 @@ }; // Call - bool closeForData = info.CloseForData(view, assessmentSectionMock); + bool closeForData = info.CloseForData(view, assessmentSection); // Assert Assert.IsTrue(closeForData); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationActivityTest.cs =================================================================== diff -u -r25d6b191a8ffd5dce434ddd07650aa1b9a76e699 -rfb9bf56793b90226745888c194ba6ae760f83f4c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationActivityTest.cs (.../GrassCoverErosionInwardsCalculationActivityTest.cs) (revision 25d6b191a8ffd5dce434ddd07650aa1b9a76e699) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationActivityTest.cs (.../GrassCoverErosionInwardsCalculationActivityTest.cs) (revision fb9bf56793b90226745888c194ba6ae760f83f4c) @@ -37,14 +37,14 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var calculation = new GrassCoverErosionInwardsCalculation(); // Call - var activity = new GrassCoverErosionInwardsCalculationActivity(calculation, "", failureMechanism, assessmentSectionMock); + var activity = new GrassCoverErosionInwardsCalculationActivity(calculation, "", failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf(activity); @@ -60,13 +60,13 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); // Call - TestDelegate call = () => new GrassCoverErosionInwardsCalculationActivity(null, "", failureMechanism, assessmentSectionMock); + TestDelegate call = () => new GrassCoverErosionInwardsCalculationActivity(null, "", failureMechanism, assessmentSection); // Assert var exception = Assert.Throws(call); @@ -79,14 +79,14 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var calculation = new GrassCoverErosionInwardsCalculation(); // Call - TestDelegate call = () => new GrassCoverErosionInwardsCalculationActivity(calculation, null, failureMechanism, assessmentSectionMock); + TestDelegate call = () => new GrassCoverErosionInwardsCalculationActivity(calculation, null, failureMechanism, assessmentSection); // Assert var exception = Assert.Throws(call); @@ -99,13 +99,13 @@ { // Setup var mocks = new MockRepository(); - var assessmentSectionMock = mocks.StrictMock(); + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var calculation = new GrassCoverErosionInwardsCalculation(); // Call - TestDelegate call = () => new GrassCoverErosionInwardsCalculationActivity(calculation, "", null, assessmentSectionMock); + TestDelegate call = () => new GrassCoverErosionInwardsCalculationActivity(calculation, "", null, assessmentSection); // Assert var exception = Assert.Throws(call);