示例#1
0
        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);
        }
示例#2
0
        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();
        }
示例#3
0
        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();
        }