public void iscollectabletype_interface_type_returns_false() { Type invalidType = typeof(ICollectableBase); bool isCollectable = CollectableBaseFactory.IsCollectableType(invalidType); Assert.IsFalse(isCollectable, "Expected to return false if passed the ICollectable interface type"); }
public void iscollectabletype_null_type_returns_false() { Type invalidType = null; bool isCollectable = CollectableBaseFactory.IsCollectableType(invalidType); Assert.IsFalse(isCollectable, "Expected to return false if passed a null type"); }
public void iscollectabletype_valid_type_returns_true() { foreach (Type validType in CollectableBaseFactory.CollectableTypes) { bool isCollectable = CollectableBaseFactory.IsCollectableType(validType); Assert.IsTrue(isCollectable, "Expected to return true if passed a ICollectable type"); } }
public HomeCollection(string collectionName, Type collectionType) { if (!CollectableBaseFactory.IsCollectableType(collectionType)) { throw new CollectionException($"Type {collectionType?.Name} must be of a valid Collectable Type"); } CollectionName = collectionName; _collectionType = collectionType; _collection = new List <ICollectableBase>(); }