public void CommandsForWithUnknownType() { var collection = new LocalCommandCollection(); var id = CommandId.Create(typeof(int).GetMethod("CompareTo", new[] { typeof(object) })); Assert.Throws <UnknownCommandException>(() => collection.CommandToInvoke(id)); }
public void CommandsFor() { var collection = new LocalCommandCollection(); var map = new[] { new CommandDefinition( CommandId.Create(typeof(int).GetMethod("CompareTo", new[] { typeof(object) })), new[] { new CommandParameterDefinition(typeof(int), "other", CommandParameterOrigin.FromCommand), }, false, (Action) delegate { }), }; collection.Register(map); var commandSet = collection.CommandToInvoke(map[0].Id); Assert.AreSame(map[0], commandSet); }