Ejemplo n.º 1
0
        public void GetObjectWithoutSupplyingASourceSet()
        {
            SetFactoryObject lfo = new SetFactoryObject();

            lfo.IsSingleton = false;
            lfo.GetObject();
        }
Ejemplo n.º 2
0
		public void GetObjectWithoutSupplyingASourceSet()
		{
			SetFactoryObject lfo = new SetFactoryObject();
			lfo.IsSingleton = false;
			lfo.GetObject();
		}
        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);
        }
		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).");
		}