public void Should_create_class_command_from_generic_type() { ClassCommandFactory.Create <ClassCommand1>() .ShouldBeEquivalentTo <ICommand>(new { Name = "class_command_1", IsDefault = false, Group = "ClassCommands", Description = "Class command 1" }); }
public static IEnumerable <ICommand> FindClassCommands(Assembly assembly) { return((from t in assembly.DefinedTypes where !t.IsAbstract && CommmandInstanceType.IsAssignableFrom(t) select ClassCommandFactory.CreateFromType(t)).ToArray()); }
public ICommand AddCommand <TInstanceCmd>(Func <ICommandContext, TInstanceCmd> factory = null) where TInstanceCmd : ICommandInstance { return(AddCommand(ClassCommandFactory.Create(factory))); }