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; } }
public void DefaultConstructor_ExpectedValues() { // Call var editor = new ViewPropertyEditor(); // Assert Assert.IsInstanceOf <UITypeEditor>(editor); }
public void GetEditStyle_Always_ReturnModal() { // Setup var editor = new ViewPropertyEditor(); // Call UITypeEditorEditStyle style = editor.GetEditStyle(); // Assert Assert.AreEqual(UITypeEditorEditStyle.Modal, style); }