예제 #1
0
        public void EditValue_Always_OpenViewForData()
        {
            // Setup
            var editor = new ViewPropertyEditor();
            var data   = new object();

            var mocks    = new MockRepository();
            var commands = mocks.StrictMock <IViewCommands>();

            commands.Expect(c => c.OpenView(data));
            mocks.ReplayAll();

            IViewCommands originalValue = ViewPropertyEditor.ViewCommands;

            try
            {
                ViewPropertyEditor.ViewCommands = commands;

                // Call
                editor.EditValue(null, null, data);

                // Assert
                mocks.VerifyAll(); // Expect 'OpenView' to be called.
            }
            finally
            {
                ViewPropertyEditor.ViewCommands = originalValue;
            }
        }
예제 #2
0
        public void DefaultConstructor_ExpectedValues()
        {
            // Call
            var editor = new ViewPropertyEditor();

            // Assert
            Assert.IsInstanceOf <UITypeEditor>(editor);
        }
예제 #3
0
        public void GetEditStyle_Always_ReturnModal()
        {
            // Setup
            var editor = new ViewPropertyEditor();

            // Call
            UITypeEditorEditStyle style = editor.GetEditStyle();

            // Assert
            Assert.AreEqual(UITypeEditorEditStyle.Modal, style);
        }