public void UseNonResolvableTypeForDictionaryValue()
        {
            IDictionary typeAliases = new Hashtable();
            typeAliases.Add("LinkedList", "Spring.Collections.LinkkkedList");

            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();
            typeAliasConfigurer.TypeAliases = typeAliases;

            typeAliasConfigurer.PostProcessObjectFactory(factory);
        }
        public void UseNonResolvableTypeForDictionaryValue()
        {
            IDictionary typeAliases = new Hashtable();
            typeAliases.Add("LinkedList", "Spring.Collections.LinkkkedList");

            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();
            typeAliasConfigurer.TypeAliases = typeAliases;

            Assert.Throws<ObjectInitializationException>(() => typeAliasConfigurer.PostProcessObjectFactory(factory));
        }
        public void UseInvalidTypeForDictionaryValue()
        {
            IDictionary typeAliases = new Hashtable();
            typeAliases.Add("LinkedList", new LinkedList());

            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();
            typeAliasConfigurer.TypeAliases = typeAliases;

            typeAliasConfigurer.PostProcessObjectFactory(factory);
        }
        public void UseInvalidTypeForDictionaryValue()
        {
            IDictionary typeAliases = new Hashtable();
            typeAliases.Add("LinkedList", new LinkedList());

            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();
            typeAliasConfigurer.TypeAliases = typeAliases;

            Assert.Throws<ObjectInitializationException>(() => typeAliasConfigurer.PostProcessObjectFactory(factory));
        }
Example #5
0
        public void UseNonResolvableTypeForDictionaryValue()
        {
            IDictionary typeAliases = new Hashtable();

            typeAliases.Add("LinkedList", "Spring.Collections.LinkkkedList");

            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();

            typeAliasConfigurer.TypeAliases = typeAliases;

            Assert.Throws <ObjectInitializationException>(() => typeAliasConfigurer.PostProcessObjectFactory(factory));
        }
Example #6
0
        public void UseInvalidTypeForDictionaryValue()
        {
            IDictionary typeAliases = new Hashtable();

            typeAliases.Add("LinkedList", new LinkedList());

            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();

            typeAliasConfigurer.TypeAliases = typeAliases;

            Assert.Throws <ObjectInitializationException>(() => typeAliasConfigurer.PostProcessObjectFactory(factory));
        }
        public void Serialization()
        {
            IDictionary typeAliases = new Hashtable();
            typeAliases.Add("LinkedList", typeof(LinkedList));

            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();
            typeAliasConfigurer.TypeAliases = typeAliases;

            typeAliasConfigurer.Order = 1;

            SerializationTestUtils.SerializeAndDeserialize(typeAliasConfigurer);
        }
        public void UseNonResolvableTypeForDictionaryValue()
        {
            IDictionary typeAliases = new Hashtable();

            typeAliases.Add("LinkedList", "Spring.Collections.LinkkkedList");

            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();

            typeAliasConfigurer.TypeAliases = typeAliases;

            typeAliasConfigurer.PostProcessObjectFactory(factory);
        }
        public void UseInvalidTypeForDictionaryValue()
        {
            IDictionary typeAliases = new Hashtable();

            typeAliases.Add("LinkedList", new LinkedList());

            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();

            typeAliasConfigurer.TypeAliases = typeAliases;

            typeAliasConfigurer.PostProcessObjectFactory(factory);
        }
Example #10
0
        public void Serialization()
        {
            IDictionary typeAliases = new Hashtable();

            typeAliases.Add("LinkedList", typeof(LinkedList).AssemblyQualifiedName);

            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();

            typeAliasConfigurer.TypeAliases = typeAliases;

            typeAliasConfigurer.Order = 1;

            SerializationTestUtils.SerializeAndDeserialize(typeAliasConfigurer);
        }
Example #11
0
        private void CreateConfigurerAndTestLinkedList(IDictionary typeAliases)
        {
            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();

            typeAliasConfigurer.TypeAliases = typeAliases;

            typeAliasConfigurer.Order = 1;


            typeAliasConfigurer.PostProcessObjectFactory(factory);

            //todo investigate mocking the typeregistry, for now ask the actual one for information.
            Assert.IsTrue(TypeRegistry.ContainsAlias("LinkedList"),
                          "TypeAliasConfigurer did not register a type alias with the TypeRegistry");

            Type linkedListType = TypeRegistry.ResolveType("LinkedList");

            Assert.IsTrue(linkedListType.Equals(typeof(LinkedList)), "Incorrect type resolved.");
            Assert.AreEqual(1, typeAliasConfigurer.Order);
        }
        private void CreateConfigurerAndTestLinkedList(IDictionary typeAliases)
        {
            TypeAliasConfigurer typeAliasConfigurer = new TypeAliasConfigurer();
            typeAliasConfigurer.TypeAliases = typeAliases;

            typeAliasConfigurer.Order = 1;


            typeAliasConfigurer.PostProcessObjectFactory(factory);

            //todo investigate mocking the typeregistry, for now ask the actual one for information.
            Assert.IsTrue(TypeRegistry.ContainsAlias("LinkedList"),
                          "TypeAliasConfigurer did not register a type alias with the TypeRegistry");

            Type linkedListType = TypeRegistry.ResolveType("LinkedList");
            Assert.IsTrue(linkedListType.Equals(typeof(LinkedList)), "Incorrect type resolved.");
            Assert.AreEqual(1,typeAliasConfigurer.Order);
        }