Esempio n. 1
0
            public void FindBy(Action <HandlerSource> configuration)
            {
                var source = new HandlerSource();

                configuration(source);

                _parent.Config.Add(source);
            }
        public void custom_method_inclusion()
        {
            var source = new HandlerSource();
            source.ExcludeTypes(x => x.Namespace != "FubuTransportation.Testing.Registration");
            source.IncludeClassesSuffixedWithConsumer();
            source.IncludeMethods(x => x.Name == "M2");

            var descriptions = source.As<IHandlerSource>().FindCalls().Select(x => x.Description);
            descriptions
                .ShouldHaveTheSameElementsAs(
            "MyConsumer.M2(M2 input) : void",
            "MyOtherConsumer.M2(M2 input) : void");
        }
        public void custom_method_inclusion()
        {
            var source = new HandlerSource();

            source.ExcludeTypes(x => x.Namespace != "FubuTransportation.Testing.Registration");
            source.IncludeClassesSuffixedWithConsumer();
            source.IncludeMethods(x => x.Name == "M2");

            var descriptions = source.As <IHandlerSource>().FindCalls().Select(x => x.Description);

            descriptions
            .ShouldHaveTheSameElementsAs(
                "MyConsumer.M2(M2 input) : void",
                "MyOtherConsumer.M2(M2 input) : void");
        }
        public void custom_type_filter_on_includeds()
        {
            var source = new HandlerSource();

            source.ExcludeTypes(x => x.Namespace != "FubuTransportation.Testing.Registration");
            source.IncludeTypes(x => x.Name == "MyConsumer");

            var descriptions = source.As <IHandlerSource>().FindCalls().Select(x => x.Description);

            descriptions
            .ShouldHaveTheSameElementsAs(
                "MyConsumer.M1(M1 input) : void",
                "MyConsumer.M2(M2 input) : void",
                "MyConsumer.M3(M3 input) : void");
        }
        public void custom_type_filter_on_excludes()
        {
            var source = new HandlerSource();
            source.ExcludeTypes(x => x.Namespace != "FubuMVC.Tests.ServiceBus.Registration");

            source.IncludeClassesSuffixedWithConsumer();
            source.ExcludeTypes(x => x.Name == "MyOtherConsumer");

            var descriptions = source.As<IHandlerSource>().FindCalls(GetType().Assembly).Result().Select(x => x.Description);
            descriptions
                .ShouldHaveTheSameElementsAs(
                    "MyConsumer.M1(M1 input) : void",
                    "MyConsumer.M2(M2 input) : void",
                    "MyConsumer.M3(M3 input) : void");
        }
Esempio n. 6
0
        public void custom_type_filter_on_excludes()
        {
            var source = new HandlerSource();

            source.ExcludeTypes(x => x.Namespace != "FubuMVC.Tests.ServiceBus.Registration");

            source.IncludeClassesSuffixedWithConsumer();
            source.ExcludeTypes(x => x.Name == "MyOtherConsumer");

            var descriptions = source.As <IHandlerSource>().FindCalls(GetType().Assembly).Result().Select(x => x.Description);

            descriptions
            .ShouldHaveTheSameElementsAs(
                "MyConsumer.M1(M1 input) : void",
                "MyConsumer.M2(M2 input) : void",
                "MyConsumer.M3(M3 input) : void");
        }
        public void apply_to_single_assembly_looking_for_Handler()
        {
            var source = new HandlerSource();
            source.ExcludeTypes(x => x.Namespace != "FubuTransportation.Testing.Registration");

            source.UseThisAssembly();
            source.IncludeClassesSuffixedWithConsumer();

            var descriptions = source.As<IHandlerSource>().FindCalls().Select(x => x.Description);
            descriptions
                .ShouldHaveTheSameElementsAs(
                "MyConsumer.M1(M1 input) : void",
            "MyConsumer.M2(M2 input) : void",
            "MyConsumer.M3(M3 input) : void",
            "MyOtherConsumer.M2(M2 input) : void",
            "MyOtherConsumer.M3(M3 input) : void",
            "MyOtherConsumer.M4(M4 input) : void");
        }
        public void uses_the_containing_assembly_by_default()
        {
            var source = new HandlerSource();

            source.ExcludeTypes(x => x.Namespace != "FubuTransportation.Testing.Registration");

            source.IncludeClassesSuffixedWithConsumer();

            var descriptions = source.As <IHandlerSource>().FindCalls().Select(x => x.Description);

            descriptions
            .ShouldHaveTheSameElementsAs(
                "MyConsumer.M1(M1 input) : void",
                "MyConsumer.M2(M2 input) : void",
                "MyConsumer.M3(M3 input) : void",
                "MyOtherConsumer.M2(M2 input) : void",
                "MyOtherConsumer.M3(M3 input) : void",
                "MyOtherConsumer.M4(M4 input) : void");
        }
Esempio n. 9
0
        public void apply_to_single_assembly_looking_for_Handler()
        {
            var source = new HandlerSource();

            source.ExcludeTypes(x => x.Namespace != "FubuMVC.Tests.ServiceBus.Registration");

            source.UseThisAssembly();
            source.IncludeClassesSuffixedWithConsumer();

            var findCalls = source.As <IHandlerSource>().FindCalls(GetType().Assembly);

            findCalls.Wait();

            var descriptions = findCalls.Result.Select(x => x.Description);

            descriptions
            .ShouldHaveTheSameElementsAs(
                "MyConsumer.M1(M1 input) : void",
                "MyConsumer.M2(M2 input) : void",
                "MyConsumer.M3(M3 input) : void",
                "MyOtherConsumer.M2(M2 input) : void",
                "MyOtherConsumer.M3(M3 input) : void",
                "MyOtherConsumer.M4(M4 input) : void");
        }
        public void custom_type_filter_on_includeds()
        {
            var source = new HandlerSource();
            source.ExcludeTypes(x => x.Namespace != "FubuTransportation.Testing.Registration");
            source.IncludeTypes(x => x.Name == "MyConsumer");

            var descriptions = source.As<IHandlerSource>().FindCalls().Select(x => x.Description);
            descriptions
                .ShouldHaveTheSameElementsAs(
                    "MyConsumer.M1(M1 input) : void",
                    "MyConsumer.M2(M2 input) : void",
                    "MyConsumer.M3(M3 input) : void");
        }