Пример #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);
        }
Пример #2
0
        public void FactoryCollectionConstructorTest2()
        {
            var inst = (FakeCollectionRestriction)CollectionRestrictionFactory.Create(typeof(FakeCollectionRestriction), _collection);

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

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