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

            Assert.Throws <ArgumentNullException>(() => lfo.TargetSetType = null);
        }
Ejemplo n.º 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.");
        }
Ejemplo n.º 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.");
        }
Ejemplo n.º 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.");
        }