public void CanValidateShouldReturnFalse() { var validator = new GenericSubclassTypeValidator(typeof(IGenericInterface<>)); Assert.That(validator.CanValidate(typeof(string)), Is.False); Assert.That(validator.CanValidate(null), Is.False); }
public void ValidateShouldNotThrow() { var validator = new GenericSubclassTypeValidator(typeof(IGenericInterface<>)); validator.Validate(typeof(Generic)); validator.Validate(typeof(ParentGeneric)); validator.Validate(typeof(ChildGeneric)); }
public void ValidateShouldThrow() { var validator = new GenericSubclassTypeValidator(typeof(IGenericInterface<>)); Assert.Throws<ArgumentException>(() => validator.Validate(new NotGeneric())); }
public void CanValidateShouldReturnTrue() { var validator = new GenericSubclassTypeValidator(typeof(IGenericInterface<>)); Assert.That(validator.CanValidate(typeof(Type)), Is.True); }