Exemplo n.º 1
0
        public void match_by_types()
        {
            source.IncludeTypes(x => x.Name.StartsWith("One"));

            theResultingGraph.ChainFor <OneEndpoint>(x => x.Report()).ShouldNotBeNull();
            theResultingGraph.ChainFor <OneController>(x => x.Report()).ShouldNotBeNull();
            theResultingGraph.ChainFor <TwoEndpoint>(x => x.Report()).ShouldBeNull();
        }
Exemplo n.º 2
0
        private IEnumerable <ActionCall> findActions()
        {
            var source = new ActionSource();

            source.Applies.ToAssemblyContainingType <IActionBehavior>();
            PackageRegistry.PackageAssemblies.Each(a => source.Applies.ToAssembly(a));
            source.IncludeTypesNamed(name => name.EndsWith("FubuDiagnostics"));
            source.IncludeTypes(type => type == typeof(FubuDiagnosticsEndpoint));

            return(source.As <IActionSource>().FindActions(null));
        }
Exemplo n.º 3
0
        private Task <ActionCall[]> findActions(BehaviorGraph graph)
        {
            var source = new ActionSource();

            source.Applies.ToAssemblyContainingType <IActionBehavior>();
            graph.PackageAssemblies.Each(a => source.Applies.ToAssembly(a));
            source.IncludeTypesNamed(name => name.EndsWith("FubuDiagnostics"));
            source.IncludeTypes(type => type == typeof(FubuDiagnosticsEndpoint));

            return(source.As <IActionSource>().FindActions(null));
        }
Exemplo n.º 4
0
 public static ActionSource IncludeTypeNamesSuffixed(this ActionSource source, params string[] suffix)
 {
     source.IncludeTypes(y => suffix.Any(z => y.Name.EndsWith(z)));
     return(source);
 }