コード例 #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);
        }