public void CreateInstance_ValidArguments_ReturnProperties() { // Setup var context = new AssessmentSectionAssemblyGroupsContext(new AssessmentSection(AssessmentSectionComposition.Dike)); // Call IObjectProperties objectProperties = info.CreateInstance(context); // Assert Assert.IsInstanceOf <AssessmentSectionAssemblyGroupsProperties>(objectProperties); Assert.AreSame(context.WrappedData, objectProperties.Data); }
public void Constructor_ExpectedValues() { // Setup var mocks = new MockRepository(); var assessmentSection = mocks.Stub <IAssessmentSection>(); mocks.ReplayAll(); // Call var context = new AssessmentSectionAssemblyGroupsContext(assessmentSection); // Assert Assert.IsInstanceOf <ObservableWrappedObjectContextBase <IAssessmentSection> >(context); Assert.AreSame(assessmentSection, context.WrappedData); mocks.VerifyAll(); }
public void CreateInstance_WithContext_SetsExpectedViewProperties() { // Setup var mocks = new MockRepository(); IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(null, mocks); mocks.ReplayAll(); var context = new AssessmentSectionAssemblyGroupsContext(assessmentSection); using (new AssemblyToolCalculatorFactoryConfig()) { // Call var view = (AssessmentSectionAssemblyGroupsView)info.CreateInstance(context); // Assert Assert.AreSame(assessmentSection.FailureMechanismContribution, view.FailureMechanismContribution); } mocks.VerifyAll(); }