public void GetViewData_WithContext_ReturnsWrappedFailureMechanismResult()
        {
            // Setup
            var assessmentSection = mocks.Stub <IAssessmentSection>();
            var failureMechanism  = new DuneErosionFailureMechanism();
            var context           = new DuneErosionFailureMechanismSectionResultContext(failureMechanism.SectionResults,
                                                                                        failureMechanism,
                                                                                        assessmentSection);

            mocks.ReplayAll();

            // Call
            object viewData = info.GetViewData(context);

            // Assert
            Assert.AreSame(failureMechanism.SectionResults, viewData);
            mocks.VerifyAll();
        }
Exemplo n.º 2
0
        public void Constructor_ExpectedValues()
        {
            // Setup
            var mocks             = new MockRepository();
            var assessmentSection = mocks.Stub <IAssessmentSection>();

            mocks.ReplayAll();

            var failureMechanism = new DuneErosionFailureMechanism();

            // Call
            var context = new DuneErosionFailureMechanismSectionResultContext(
                failureMechanism.SectionResults, failureMechanism, assessmentSection);

            // Assert
            Assert.IsInstanceOf <FailureMechanismSectionResultContext <NonAdoptableFailureMechanismSectionResult> >(context);
            mocks.VerifyAll();
        }
        public void CreateInstance_WithContext_ReturnsView()
        {
            // Setup
            var assessmentSection = mocks.Stub <IAssessmentSection>();

            mocks.ReplayAll();

            var failureMechanism = new DuneErosionFailureMechanism();
            var context          = new DuneErosionFailureMechanismSectionResultContext(failureMechanism.SectionResults,
                                                                                       failureMechanism,
                                                                                       assessmentSection);

            // Call
            IView view = info.CreateInstance(context);

            // Assert
            Assert.IsInstanceOf <NonAdoptableFailureMechanismResultView <DuneErosionFailureMechanism> >(view);

            mocks.VerifyAll();
        }