public void AddTest()
        {
            var coll = new LeftRightMenuCollection();

            coll.Menu("AA").Alignment = MenuAlignment.Left;
            coll.Menu("BB").Alignment = MenuAlignment.Right;

            Assert.IsTrue(coll.LeftMenuItems.Count == 1);
            Assert.IsTrue(coll.RightMenuItems.Count == 1);

            coll.Menu("AA").Alignment = MenuAlignment.Right;

            Assert.IsTrue(coll.LeftMenuItems.Count == 0);
            Assert.IsTrue(coll.RightMenuItems.Count == 2);

            coll.Menu("AA").Alignment = MenuAlignment.Left;
            coll.Menu("BB").Alignment = MenuAlignment.Left;

            Assert.IsTrue(coll.LeftMenuItems.Count == 2);
            Assert.IsTrue(coll.RightMenuItems.Count == 0);

            coll.Remove("AA");
            coll.Remove("BB");

            Assert.IsTrue(coll.LeftMenuItems.Count == 0);
            Assert.IsTrue(coll.RightMenuItems.Count == 0);
            Assert.IsTrue(coll.Count == 0);
        }
Пример #2
0
 public ShellMenuViewModel()
 {
     InternalCollection = new LeftRightMenuCollection();
     MainMenuCommand    = new ActionCommand(MainMenuAction);
 }