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); }
public void FactoryCollectionConstructorTest2() { var inst = (FakeCollectionRestriction)CollectionRestrictionFactory.Create(typeof(FakeCollectionRestriction), _collection); Assert.IsNotNull(inst); Assert.IsNotNull(inst.collection); }
public void FactoryCollectionWrongTypeTest2() { Assert.Catch <MissingMethodException>(() => { CollectionRestrictionFactory.Create(typeof(IItemInstance), _collection); }); }
public void FactoryCollectionConstructorTest() { var inst = CollectionRestrictionFactory.Create <FakeCollectionRestriction>(_collection); Assert.IsNotNull(inst); Assert.IsNotNull(inst.collection); }