Exemplo n.º 1
0
        public void ShouldResolveTypeWithDependencies()
        {
            var glower = new Glower();

            glower.Bind <IFooDependency, FooDependency>();
            glower.Bind <INestedDependency, NestedDependency>();
            glower.Bind <IAnotherFooDependency, AnotherFooDependency>();

            var foo = glower.Resolve <Foo>();

            foo.Should().Not.Be.Null();
        }
Exemplo n.º 2
0
        public void ShouldBindGenericTypes()
        {
            var glower = new Glower();

            glower.Bind<IFooDependency, FooDependency>();

            var resolved = glower.Resolve<IFooDependency>();
            resolved.Should().Not.Be.Null();
            resolved.Should().Be.OfType<FooDependency>();
        }
Exemplo n.º 3
0
        public void ShouldResolveBindedInstance()
        {
            var glower   = new Glower();
            var instance = new FooDependency();

            glower.Bind(instance);

            var resolved = glower.Resolve <FooDependency>();

            resolved.Should().Be.SameInstanceAs(instance);
        }
Exemplo n.º 4
0
        public void ShouldBindGenericTypes()
        {
            var glower = new Glower();

            glower.Bind <IFooDependency, FooDependency>();

            var resolved = glower.Resolve <IFooDependency>();

            resolved.Should().Not.Be.Null();
            resolved.Should().Be.OfType <FooDependency>();
        }
Exemplo n.º 5
0
        public void ShouldResolveBindedInstance()
        {
            var glower = new Glower();
            var instance = new FooDependency();

            glower.Bind(instance);

            var resolved = glower.Resolve<FooDependency>();

            resolved.Should().Be.SameInstanceAs(instance);
        }
Exemplo n.º 6
0
        public void ShouldResolveTypeWithDependencies()
        {
            var glower = new Glower();

            glower.Bind<IFooDependency, FooDependency>();
            glower.Bind<INestedDependency, NestedDependency>();
            glower.Bind<IAnotherFooDependency, AnotherFooDependency>();

            var foo = glower.Resolve<Foo>();

            foo.Should().Not.Be.Null();
        }