예제 #1
0
        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).");
        }
예제 #2
0
        public void SetTargetSetTypeToNull()
        {
            SetFactoryObject lfo = new SetFactoryObject();

            Assert.Throws <ArgumentNullException>(() => lfo.TargetSetType = null);
        }
예제 #3
0
        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 'Oragon.Spring.Collections.ISet' interface.");
        }
예제 #4
0
        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 'Oragon.Spring.Collections.ISet' interface.");
        }
예제 #5
0
        public void SetTargetSetTypeToNonSetType()
        {
            SetFactoryObject lfo = new SetFactoryObject();

            Assert.Throws <ArgumentException>(() => lfo.TargetSetType = typeof(ICollection), "The Type passed to the TargetSetType property must implement the 'Oragon.Spring.Collections.ISet' interface.");
        }