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

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

            Assert.Throws <InvalidOperationException>(() => menuItem.SetCheckbox(false));
        }
Beispiel #2
0
        public void SetCheckboxTest()
        {
            var menuItem = new MenuItemDefinition("Sample");

            menuItem.SetCheckbox(false);

            Assert.True(menuItem.IsCheckbox);
        }
Beispiel #3
0
        public void SetCheckboxWhenContainsSubItemsTest()
        {
            var menuItem = new MenuItemDefinition("Sample");
            var subItem  = new MenuItemDefinition("Sample Sub Item");

            menuItem.SubItems.Add(subItem);

            Assert.Throws <InvalidOperationException>(() => menuItem.SetCheckbox(false));
        }