상속: Spring.Objects.Factory.Config.AbstractFactoryObject
예제 #1
0
        public void GetObjectWithoutSupplyingASourceSet()
        {
            SetFactoryObject lfo = new SetFactoryObject();

            lfo.IsSingleton = false;
            lfo.GetObject();
        }
예제 #2
0
		public void GetObjectWithoutSupplyingASourceSet()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.IsSingleton = false;
			lfo.GetObject();
		}
예제 #3
0
		public void SetTargetSetTypeToNull()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.TargetSetType = null;
		}
예제 #4
0
		public void SetTargetSetTypeToAbstractISetInterfaceType()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.TargetSetType = typeof (AbstractSet);
		}
예제 #5
0
		public void SetTargetSetTypeToDerivedISetInterfaceType()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.TargetSetType = typeof (IExtendedSet);
		}
예제 #6
0
		public void SetTargetSetTypeToNonSetType()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.TargetSetType = typeof (ICollection);
		}
예제 #7
0
        public void SetTargetSetTypeToNull()
        {
            SetFactoryObject lfo = new SetFactoryObject();

            lfo.TargetSetType = null;
        }
예제 #8
0
        public void SetTargetSetTypeToDerivedISetInterfaceType()
        {
            SetFactoryObject lfo = new SetFactoryObject();

            lfo.TargetSetType = typeof(IExtendedSet);
        }
예제 #9
0
        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);
        }
예제 #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.");
		}