public void Constructor_ExpectedValues() { // Setup var mocks = new MockRepository(); var assessmentSection = mocks.Stub <IAssessmentSection>(); mocks.ReplayAll(); var failureMechanism = new HeightStructuresFailureMechanism(); // Call var context = new HeightStructuresFailureMechanismSectionResultContext( failureMechanism.SectionResults, failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf <FailureMechanismSectionResultContext <AdoptableFailureMechanismSectionResult> >(context); mocks.VerifyAll(); }
public void GetViewData_WithContext_ReturnsSectionResults() { // Setup var mocks = new MockRepository(); var assessmentSection = mocks.Stub <IAssessmentSection>(); mocks.ReplayAll(); var failureMechanism = new HeightStructuresFailureMechanism(); var context = new HeightStructuresFailureMechanismSectionResultContext( failureMechanism.SectionResults, failureMechanism, assessmentSection); // Call object viewData = info.GetViewData(context); // Assert Assert.AreSame(failureMechanism.SectionResults, viewData); mocks.VerifyAll(); }
public void CreateInstance_WithContext_ReturnsView() { // Setup var failureMechanism = new HeightStructuresFailureMechanism(); var mocks = new MockRepository(); IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(failureMechanism, mocks); mocks.ReplayAll(); var context = new HeightStructuresFailureMechanismSectionResultContext( failureMechanism.SectionResults, failureMechanism, assessmentSection); // Call IView view = info.CreateInstance(context); // Assert Assert.IsInstanceOf <StructuresFailureMechanismResultView <HeightStructuresFailureMechanism, HeightStructuresInput> >(view); mocks.VerifyAll(); }