private DoDisplayMacro ( object commandObject, XCore.UIItemDisplayProperties display, IVwSelection sel ) : bool | ||
commandObject | object | |
display | XCore.UIItemDisplayProperties | |
sel | IVwSelection | |
Результат | bool |
public void DoDisplayMacro_NoMacro_HidesCommand() { var props = new UIItemDisplayProperties(null, "SomeMacro", true, null, false); var ml = new MacroListener(); var command = GetF4CommandObject(); ml.DoDisplayMacro(command, props, null); Assert.That(props.Visible, Is.False); // no implementation of F4, hide it altogether. }
public void DoDisplayMacro_NoMacro_HidesCommand() { var props = new UIItemDisplayProperties(null, "SomeMacro", true, null, false); var ml = new MacroListener(); using (var command = GetF4CommandObject()) { ml.DoDisplayMacro(command, props, null); Assert.That(props.Visible, Is.False); // no implementation of F4, hide it altogether. } }
public void DoDisplayMacro_NoSelection_ShowsDisabledCommand() { var props = new UIItemDisplayProperties(null, "SomeMacro", true, null, false); var ml = new MacroListener(); SetupF4Implementation(ml); var command = GetF4CommandObject(); ml.DoDisplayMacro(command, props, null); Assert.That(props.Visible, Is.True); Assert.That(props.Enabled, Is.False); // can't do it without a selection Assert.That(props.Text, Is.EqualTo("F4test")); }
public void DoDisplayMacro_NoSelection_ShowsDisabledCommand() { var props = new UIItemDisplayProperties(null, "SomeMacro", true, null, false); var ml = new MacroListener(); SetupF4Implementation(ml); using (var command = GetF4CommandObject()) { ml.DoDisplayMacro(command, props, null); Assert.That(props.Visible, Is.True); Assert.That(props.Enabled, Is.False); // can't do it without a selection Assert.That(props.Text, Is.EqualTo("F4test")); } }