Example #1
0
        public void can_discover_extension_commands()
        {
            var factory = new CommandFactory();

            factory.RegisterCommandsFromExtensionAssemblies();

            factory.AllCommandTypes()
            .ShouldContain(typeof(ExtensionCommand));

            factory.AllCommandTypes()
            .ShouldContain(typeof(Extension2Command));
        }
        public void all_commands_usage_graph_works()
        {
            var factory = new CommandFactory();

            factory.RegisterCommands(typeof(IFubuCommand).Assembly);

            factory.AllCommandTypes().Each(t =>
            {
                try
                {
                    var usageGraph = new UsageGraph(t);
                    usageGraph.WriteUsages("fubu");

                    usageGraph.Usages.Any().ShouldBeTrue();
                }
                catch (Exception e)
                {
                    throw new ApplicationException("Command type:  " + t.FullName, e);
                }
            });
        }