Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsDesignWaterLevelCalculationsViewInfoTest.cs =================================================================== diff -u -r6f33b44599df032ecae3342b0aacd606a9e87c1f -r67d4254e33530e24d4d331437092392b69553ddd --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsDesignWaterLevelCalculationsViewInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelCalculationsViewInfoTest.cs) (revision 6f33b44599df032ecae3342b0aacd606a9e87c1f) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsDesignWaterLevelCalculationsViewInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelCalculationsViewInfoTest.cs) (revision 67d4254e33530e24d4d331437092392b69553ddd) @@ -77,8 +77,10 @@ // Call object calculations = info.GetViewData(new GrassCoverErosionOutwardsDesignWaterLevelCalculationsContext( expectedCalculations, + new GrassCoverErosionOutwardsFailureMechanism(), assessmentSection, - new GrassCoverErosionOutwardsFailureMechanism())); + () => 0.01, + "Category")); // Assert Assert.AreSame(calculations, expectedCalculations); @@ -104,8 +106,10 @@ var grassCoverErosionOutwardsFailureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); var context = new GrassCoverErosionOutwardsDesignWaterLevelCalculationsContext(new ObservableList(), + grassCoverErosionOutwardsFailureMechanism, assessmentSection, - grassCoverErosionOutwardsFailureMechanism); + () => 0.01, + "Category"); plugin.Gui = gui; plugin.Activate(); @@ -115,6 +119,7 @@ // Assert Assert.AreSame(assessmentSection, view.AssessmentSection); + Assert.AreSame(grassCoverErosionOutwardsFailureMechanism, view.FailureMechanism); } mockRepository.VerifyAll(); @@ -137,18 +142,32 @@ } [Test] - public void GetViewName_Always_ReturnsViewName() + public void GetViewName_WithContext_ReturnsViewNameContainingCategoryBoundaryName() { // Setup + const string categoryBoundaryName = "Category"; + + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + using (var plugin = new GrassCoverErosionOutwardsPlugin()) { ViewInfo info = GetInfo(plugin); + + var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); + var context = new GrassCoverErosionOutwardsDesignWaterLevelCalculationsContext(new ObservableList(), + failureMechanism, + assessmentSection, + () => 0.01, + categoryBoundaryName); // Call - string name = info.GetViewName(null, null); + string name = info.GetViewName(null, context); // Assert - Assert.AreEqual("Waterstanden bij doorsnede-eis", name); + Assert.AreEqual($"Waterstanden - {categoryBoundaryName}", name); + mocks.VerifyAll(); } } @@ -169,8 +188,10 @@ var grassCoverErosionOutwardsFailureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); var data = new GrassCoverErosionOutwardsDesignWaterLevelCalculationsContext(new ObservableList(), + grassCoverErosionOutwardsFailureMechanism, assessmentSection, - grassCoverErosionOutwardsFailureMechanism); + () => 0.01, + "Category"); plugin.Gui = gui; plugin.Activate(); @@ -184,7 +205,6 @@ info.AfterCreate(view, data); // Assert - Assert.AreSame(grassCoverErosionOutwardsFailureMechanism, view.FailureMechanism); Assert.IsInstanceOf(view.CalculationGuiService); } }