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_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 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"); }