Ejemplo n.º 1
0
        public void smoke_test_the_with_types()
        {
            var registry = new FubuRegistry();
            registry.Applies.ToThisAssembly();
            registry.WithTypes(types =>
            {
                types.TypesMatching(x => x.IsConcreteTypeOf<MyInterface>()).Each(type =>
                {
                    registry.Services(s => s.AddService(typeof(MyInterface), new ObjectDef(type)));
                });
            });

            registry.BuildGraph().Services.ServicesFor<MyInterface>()
                .Single().Type.ShouldEqual(typeof (MyConcreteClass));
        }