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")); }
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); } }
public void CommandPathLengthTest() { var path = new CommandPath("alpha", "bravo", "charly", "delta"); Assert.AreEqual("alpha bravo charly delta".Length, path.Length); }