Esempio n. 1
0
        public void CommandPathMatchTest()
        {
            var path = new CommandPath("alpha", "bravo", "charly", "delta");

            Assert.IsTrue(path.Matches("alpha bravo charly delta"));
            Assert.IsFalse(path.Matches("alpha b charly delta"));
            Assert.IsFalse(path.Matches("alpha bravo charly"));
            Assert.IsFalse(path.Matches("alpha bravo"));
            Assert.IsFalse(path.Matches("alpha"));
        }
Esempio n. 2
0
        private void ExecuteBindingMode(object parameter)
        {
            var command = Command;

            Debug.Assert(command != null, $"{nameof(Command)} must not be null in {nameof(ItemClickCommandMode.Binding)} mode");
            Debug.Assert(CommandPath.IsNullOrWhiteSpace(), $"{nameof(CommandPath)} is ineffective in {nameof(ItemClickCommandMode.Binding)} mode");

            if (command != null && command.CanExecute(parameter))
            {
                command.Execute(parameter);
            }
        }
Esempio n. 3
0
        public void CommandPathLengthTest()
        {
            var path = new CommandPath("alpha", "bravo", "charly", "delta");

            Assert.AreEqual("alpha bravo charly delta".Length, path.Length);
        }