예제 #1
0
        public void SetCheckboxWhenIsCommandTest()
        {
            var menuItem = new MenuItemDefinition("Sample");

            menuItem.SetCommand(new Command(() => { }));

            Assert.Throws <InvalidOperationException>(() => menuItem.SetCheckbox(false));
        }
예제 #2
0
        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(() => { })));
        }
예제 #3
0
        public void SetCommandTest()
        {
            var menuItem = new MenuItemDefinition("Sample");
            var command  = new Command(() => { });

            menuItem.SetCommand(command);

            Assert.AreSame(command, menuItem.Command);
        }