public void CreateInstance_WithContext_SetsData()
        {
            // Setup
            var  mocks             = new MockRepository();
            var  assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike);
            var  viewCommands      = mocks.Stub <IViewCommands>();
            IGui gui = StubFactory.CreateGuiStub(mocks);

            gui.Stub(g => g.ViewCommands).Return(viewCommands);
            mocks.ReplayAll();

            using (var plugin = new RiskeerPlugin())
            {
                plugin.Gui = gui;

                var context = new TestStateRootContext(assessmentSection);

                PropertyInfo info = GetInfo(plugin);

                // Call
                IObjectProperties objectProperties = info.CreateInstance(context);

                // Assert
                Assert.IsInstanceOf <AssessmentSectionProperties>(objectProperties);
                Assert.AreSame(assessmentSection, objectProperties.Data);
            }

            mocks.VerifyAll();
        }
Пример #2
0
        public void Constructor_ExpectedValues()
        {
            // Setup
            var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike);

            // Call
            var context = new TestStateRootContext(assessmentSection);

            // Assert
            Assert.IsInstanceOf <ObservableWrappedObjectContextBase <AssessmentSection> >(context);
            Assert.AreSame(assessmentSection, context.WrappedData);
        }