public void CreateInstance_ValidData_NewPropertiesWithPipingOutputAsData() { // Setup var failureMechanism = new PipingFailureMechanism(); var mocks = new MockRepository(); IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(failureMechanism, mocks); mocks.ReplayAll(); SemiProbabilisticPipingOutput output = PipingTestDataGenerator.GetRandomSemiProbabilisticPipingOutput(); var context = new SemiProbabilisticPipingOutputContext(output, failureMechanism, assessmentSection); // Call IObjectProperties objectProperties = info.CreateInstance(context); // Assert Assert.IsInstanceOf <SemiProbabilisticPipingOutputProperties>(objectProperties); Assert.AreSame(output, objectProperties.Data); mocks.VerifyAll(); }
public void Constructor_ExpectedValues() { // Setup var mocks = new MockRepository(); var assessmentSection = mocks.Stub <IAssessmentSection>(); mocks.ReplayAll(); SemiProbabilisticPipingOutput output = PipingTestDataGenerator.GetRandomSemiProbabilisticPipingOutput(); var failureMechanism = new PipingFailureMechanism(); // Call var context = new SemiProbabilisticPipingOutputContext(output, failureMechanism, assessmentSection); // Assert Assert.IsInstanceOf <WrappedObjectContextBase <SemiProbabilisticPipingOutput> >(context); Assert.AreSame(output, context.WrappedData); Assert.AreSame(failureMechanism, context.FailureMechanism); Assert.AreSame(assessmentSection, context.AssessmentSection); mocks.VerifyAll(); }