public void RemoveTest()
        {
            ICommandAggregator cmdAgg = CommandAggregatorFactory.GetNewCommandAggregator();

            cmdAgg.AddOrSetCommand("TestCommand1", new RelayCommand(p1 => { }, p2 => true));
            cmdAgg.AddOrSetCommand("TestCommand2", new RelayCommand(p1 => { }, p2 => true));
            cmdAgg.AddOrSetCommand("TestCommand3", new RelayCommand(p1 => { }, p2 => true));
            cmdAgg.AddOrSetCommand("TestCommand4", new RelayCommand(p1 => { }, p2 => true));
            cmdAgg.AddOrSetCommand("TestCommand5", new RelayCommand(p1 => { }, p2 => true));
            Assert.IsTrue(cmdAgg.Count() == 5);

            cmdAgg.Remove("TestCommand3");
            Assert.IsTrue(cmdAgg.Count() == 4);
            Assert.IsTrue(cmdAgg.Exists("TestCommand1"));
            Assert.IsTrue(cmdAgg.Exists("TestCommand2"));
            Assert.IsFalse(cmdAgg.Exists("TestCommand3"));
            Assert.IsTrue(cmdAgg.Exists("TestCommand4"));
            Assert.IsTrue(cmdAgg.Exists("TestCommand5"));


            cmdAgg.RemoveAll();
            Assert.IsTrue(cmdAgg.Count() == 0);
            Assert.IsFalse(cmdAgg.Exists("TestCommand1"));
            Assert.IsFalse(cmdAgg.Exists("TestCommand2"));
            Assert.IsFalse(cmdAgg.Exists("TestCommand3"));
            Assert.IsFalse(cmdAgg.Exists("TestCommand4"));
            Assert.IsFalse(cmdAgg.Exists("TestCommand5"));
        }
        public void CountTest()
        {
            ICommandAggregator cmdAgg = CommandAggregatorFactory.GetNewCommandAggregator();

            Assert.AreEqual(0, cmdAgg.Count());
            cmdAgg.AddOrSetCommand("TestCommand1", new RelayCommand(p1 => { }, p2 => true));
            cmdAgg.AddOrSetCommand("TestCommand2", new RelayCommand(p1 => { }, p2 => true));

            Assert.AreEqual(2, cmdAgg.Count());
        }
        public void CollectionConstructionTest()
        {
            ICommand cmd1 = new RelayCommand(p1 => { }, p2 => true);
            ICommand cmd2 = new RelayCommand(p1 => { }, p2 => true);

            var commandList = new List <KeyValuePair <string, ICommand> >();

            commandList.Add(new KeyValuePair <string, ICommand>("A", cmd1));
            commandList.Add(new KeyValuePair <string, ICommand>("B", cmd2));
            ICommandAggregator cmdAgg = CommandAggregatorFactory.GetNewCommandAggregator(commandList);

            Assert.IsTrue(cmdAgg.Exists("A"));
            Assert.IsTrue(cmdAgg.Exists("B"));
            Assert.IsTrue(cmdAgg.Count() == 2);
        }