Beispiel #1
0
        public void FactoryCollectionWrongTypeTest3()
        {
            var inst = (FakeCollectionRestriction)CollectionRestrictionFactory.Create(typeof(FakeCollectionRestriction), (ICollection)null); // Defaults to empty constructor because given type is not a collection

            Assert.IsNotNull(inst);
            Assert.IsNull(inst.collection);
        }
Beispiel #2
0
        public void FactoryCollectionConstructorTest2()
        {
            var inst = (FakeCollectionRestriction)CollectionRestrictionFactory.Create(typeof(FakeCollectionRestriction), _collection);

            Assert.IsNotNull(inst);
            Assert.IsNotNull(inst.collection);
        }
Beispiel #3
0
 public void FactoryCollectionWrongTypeTest2()
 {
     Assert.Catch <MissingMethodException>(() =>
     {
         CollectionRestrictionFactory.Create(typeof(IItemInstance), _collection);
     });
 }
Beispiel #4
0
        public void FactoryCollectionConstructorTest()
        {
            var inst = CollectionRestrictionFactory.Create <FakeCollectionRestriction>(_collection);

            Assert.IsNotNull(inst);
            Assert.IsNotNull(inst.collection);
        }