public void SetCheckboxWhenIsCommandTest() { var menuItem = new MenuItemDefinition("Sample"); menuItem.SetCommand(new Command(() => { })); Assert.Throws <InvalidOperationException>(() => menuItem.SetCheckbox(false)); }
public void SetCommandWhenContainsSubItemsTest() { var menuItem = new MenuItemDefinition("Sample"); var subItem = new MenuItemDefinition("Sample Sub Item"); menuItem.SubItems.Add(subItem); Assert.Throws <InvalidOperationException>(() => menuItem.SetCommand(new Command(() => { }))); }
public void SetCommandTest() { var menuItem = new MenuItemDefinition("Sample"); var command = new Command(() => { }); menuItem.SetCommand(command); Assert.AreSame(command, menuItem.Command); }