Index: Riskeer/Integration/src/Riskeer.Integration.Forms/PresentationObjects/NormClassesContext.cs =================================================================== diff -u -rbac21c8c37a2685b531f0dff891b282e34e06b24 -rb3416d1613991b2c95dc32a9c501c6096be910ba --- Riskeer/Integration/src/Riskeer.Integration.Forms/PresentationObjects/NormClassesContext.cs (.../NormClassesContext.cs) (revision bac21c8c37a2685b531f0dff891b282e34e06b24) +++ Riskeer/Integration/src/Riskeer.Integration.Forms/PresentationObjects/NormClassesContext.cs (.../NormClassesContext.cs) (revision b3416d1613991b2c95dc32a9c501c6096be910ba) @@ -21,20 +21,20 @@ using System; using Core.Common.Controls.PresentationObjects; -using Riskeer.Integration.Data; +using Riskeer.Common.Data.AssessmentSection; namespace Riskeer.Integration.Forms.PresentationObjects { /// - /// Presentation object for presenting the norm classes of an . + /// Presentation object for presenting the norm classes of an . /// - public class NormClassesContext : ObservableWrappedObjectContextBase + public class NormClassesContext : ObservableWrappedObjectContextBase { /// /// Creates a new instance of . /// /// The assessment section to present the norm classes for. /// Thrown when is null. - public NormClassesContext(AssessmentSection assessmentSection) : base(assessmentSection) {} + public NormClassesContext(IAssessmentSection assessmentSection) : base(assessmentSection) {} } } \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PresentationObjects/NormClassesContextTest.cs =================================================================== diff -u -rbac21c8c37a2685b531f0dff891b282e34e06b24 -rb3416d1613991b2c95dc32a9c501c6096be910ba --- Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PresentationObjects/NormClassesContextTest.cs (.../NormClassesContextTest.cs) (revision bac21c8c37a2685b531f0dff891b282e34e06b24) +++ Riskeer/Integration/test/Riskeer.Integration.Forms.Test/PresentationObjects/NormClassesContextTest.cs (.../NormClassesContextTest.cs) (revision b3416d1613991b2c95dc32a9c501c6096be910ba) @@ -21,7 +21,9 @@ using Core.Common.Controls.PresentationObjects; using NUnit.Framework; +using Rhino.Mocks; using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Common.Data.TestUtil; using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; @@ -34,14 +36,18 @@ public void Constructor_ValidParameters_ExpectedValues() { // Setup - var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(null, mocks); + mocks.ReplayAll(); // Call var context = new NormClassesContext(assessmentSection); // Assert Assert.IsInstanceOf>(context); Assert.AreSame(assessmentSection, context.WrappedData); + + mocks.VerifyAll(); } } } \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/NormClassesContextTreeNodeInfoTest.cs =================================================================== diff -u -r28eb5cbe63e6fe992d25a4856fbd1564ca657236 -rb3416d1613991b2c95dc32a9c501c6096be910ba --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/NormClassesContextTreeNodeInfoTest.cs (.../NormClassesContextTreeNodeInfoTest.cs) (revision 28eb5cbe63e6fe992d25a4856fbd1564ca657236) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/NormClassesContextTreeNodeInfoTest.cs (.../NormClassesContextTreeNodeInfoTest.cs) (revision b3416d1613991b2c95dc32a9c501c6096be910ba) @@ -19,7 +19,6 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System; using System.Drawing; using System.Linq; using Core.Common.Controls.TreeView; @@ -29,9 +28,9 @@ using NUnit.Framework; using Rhino.Mocks; using Riskeer.Common.Data.AssessmentSection; +using Riskeer.Common.Data.TestUtil; using Riskeer.Common.Forms.Properties; using Riskeer.Common.Plugin.TestUtil; -using Riskeer.Integration.Data; using Riskeer.Integration.Forms.PresentationObjects; namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos @@ -105,11 +104,11 @@ public void ContextMenuStrip_Always_CallsContextMenuBuilderMethods() { // Setup - var random = new Random(21); - var assessmentSection = new AssessmentSection(random.NextEnumValue()); + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(null, mocks); + var context = new NormClassesContext(assessmentSection); - var mocks = new MockRepository(); var menuBuilder = mocks.StrictMock(); using (mocks.Ordered()) Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/AssessmentSectionAssemblyCategoriesViewInfoTest.cs =================================================================== diff -u -r3d5c835f1c5e9c36bf85f2a9a6fd3fb9b9772d6a -rb3416d1613991b2c95dc32a9c501c6096be910ba --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/AssessmentSectionAssemblyCategoriesViewInfoTest.cs (.../AssessmentSectionAssemblyCategoriesViewInfoTest.cs) (revision 3d5c835f1c5e9c36bf85f2a9a6fd3fb9b9772d6a) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/AssessmentSectionAssemblyCategoriesViewInfoTest.cs (.../AssessmentSectionAssemblyCategoriesViewInfoTest.cs) (revision b3416d1613991b2c95dc32a9c501c6096be910ba) @@ -60,27 +60,27 @@ Assert.AreEqual(typeof(FailureMechanismContribution), info.ViewDataType); } - // [Test] - // public void CreateInstance_WithContext_SetsExpectedViewProperties() - // { - // // Setup - // var mocks = new MockRepository(); - // IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(null, mocks); - // mocks.ReplayAll(); - // - // var context = new NormClassesContext(assessmentSection); - // using (new AssemblyToolCalculatorFactoryConfigOld()) - // { - // // Call - // var view = (AssessmentSectionAssemblyCategoriesView) info.CreateInstance(context); - // - // // Assert - // Assert.AreSame(assessmentSection.FailureMechanismContribution, view.FailureMechanismContribution); - // } - // - // mocks.VerifyAll(); - // } + [Test] + public void CreateInstance_WithContext_SetsExpectedViewProperties() + { + // Setup + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(null, mocks); + mocks.ReplayAll(); + var context = new NormClassesContext(assessmentSection); + using (new AssemblyToolCalculatorFactoryConfigOld()) + { + // Call + var view = (AssessmentSectionAssemblyCategoriesView) info.CreateInstance(context); + + // Assert + Assert.AreSame(assessmentSection.FailureMechanismContribution, view.FailureMechanismContribution); + } + + mocks.VerifyAll(); + } + [Test] public void GetViewName_Always_ReturnsViewName() {