Inheritance: Spring.Objects.Factory.Config.AbstractFactoryObject
        public void GetObjectWithoutSupplyingASourceSet()
        {
            SetFactoryObject lfo = new SetFactoryObject();

            lfo.IsSingleton = false;
            lfo.GetObject();
        }
		public void GetObjectWithoutSupplyingASourceSet()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.IsSingleton = false;
			lfo.GetObject();
		}
		public void SetTargetSetTypeToNull()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.TargetSetType = null;
		}
		public void SetTargetSetTypeToAbstractISetInterfaceType()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.TargetSetType = typeof (AbstractSet);
		}
		public void SetTargetSetTypeToDerivedISetInterfaceType()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.TargetSetType = typeof (IExtendedSet);
		}
		public void SetTargetSetTypeToNonSetType()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.TargetSetType = typeof (ICollection);
		}
        public void SetTargetSetTypeToNull()
        {
            SetFactoryObject lfo = new SetFactoryObject();

            lfo.TargetSetType = null;
        }
        public void SetTargetSetTypeToDerivedISetInterfaceType()
        {
            SetFactoryObject lfo = new SetFactoryObject();

            lfo.TargetSetType = typeof(IExtendedSet);
        }
        public void SetTargetSetTypeToAbstractISetInterfaceType()
        {
            SetFactoryObject lfo = new SetFactoryObject();

            lfo.TargetSetType = typeof(AbstractSet);
        }
        public void CollectionFactoryDefaults()
        {
            ListFactoryObject listFactory = new ListFactoryObject();
            listFactory.SourceList = new ArrayList();
            listFactory.AfterPropertiesSet();
            Assert.IsTrue(listFactory.GetObject() is ArrayList);

            SetFactoryObject setFactory = new SetFactoryObject();
            setFactory.SourceSet = new HybridSet();
            setFactory.AfterPropertiesSet();
            Assert.IsTrue(setFactory.GetObject() is HybridSet);

            DictionaryFactoryObject dictionaryFactory = new DictionaryFactoryObject();
            dictionaryFactory.SourceDictionary = new Hashtable();
            dictionaryFactory.AfterPropertiesSet();
            Assert.IsTrue(dictionaryFactory.GetObject() is Hashtable);
        }
Esempio n. 11
0
        public void SetTargetSetTypeToNonSetType()
        {
            SetFactoryObject lfo = new SetFactoryObject();

            lfo.TargetSetType = typeof(ICollection);
        }
		public void GetObjectWithoutSupplyingASourceSet()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.IsSingleton = false;
            Assert.Throws<ArgumentException>(() => lfo.GetObject(), "The 'SourceSet' property cannot be null (Nothing in Visual Basic.NET).");
		}
		public void SetTargetSetTypeToNull()
		{
			SetFactoryObject lfo = new SetFactoryObject();
            Assert.Throws<ArgumentNullException>(() => lfo.TargetSetType = null);
		}
		public void SetTargetSetTypeToAbstractISetInterfaceType()
		{
			SetFactoryObject lfo = new SetFactoryObject();
            Assert.Throws<ArgumentException>(() => lfo.TargetSetType = typeof (AbstractSet), "The Type passed to the TargetSetType property cannot be abstract (MustInherit in VisualBasic.NET); it must be a concrete class that implements the 'Spring.Collections.ISet' interface.");
		}
		public void SetTargetSetTypeToDerivedISetInterfaceType()
		{
			SetFactoryObject lfo = new SetFactoryObject();
            Assert.Throws<ArgumentException>(() => lfo.TargetSetType = typeof (IExtendedSet), "The Type passed to the TargetSetType property cannot be an interface; it must be a concrete class that implements the 'Spring.Collections.ISet' interface.");
		}
		public void SetTargetSetTypeToNonSetType()
		{
			SetFactoryObject lfo = new SetFactoryObject();
            Assert.Throws<ArgumentException>(() => lfo.TargetSetType = typeof (ICollection), "The Type passed to the TargetSetType property must implement the 'Spring.Collections.ISet' interface.");
		}