コード例 #1
0
        public void doesnt_resolve_other_types()
        {
            request.SetupGet(r => r.Service).Returns(typeof(Sword));

            var resolver = new FactoryBindingResolver();

            var result = resolver.Resolve(new Multimap<Type, IBinding>(), request.Object);

            Assert.Equal(0, result.Count());
        }
コード例 #2
0
        public void doesnt_resolve_for_factory_of_nonexisting_service()
        {
            request.SetupGet(r => r.Service).Returns(typeof(Func<Sword>));

            var resolver = new FactoryBindingResolver();

            var result = resolver.Resolve(new Multimap<Type, IBinding>(), request.Object);

            Assert.Equal(0, result.Count());
        }
コード例 #3
0
        public IBinding resolves_for_factory_of_existing_service()
        {
            request.SetupGet(r => r.Service).Returns(typeof(Func<Sword>));

            var resolver = new FactoryBindingResolver();

            var maps = new Multimap<Type, IBinding>();
            maps.Add(typeof(Sword), new Binding(typeof(Sword)));

            IBinding result = resolver.Resolve(maps, request.Object).Single();

            return result;
        }