public void WhenGetValidatorFromTypeThenShouldNotBeNull() { //ARRANGE ValidatorsTable.Add(new ValidatorBase <Entity>()); ValidatorsTable.Add(new ValidatorBase <Entity2>()); //ACT var v = ValidatorsTable.Get <Entity>(); var v2 = ValidatorsTable.Get <Entity2>(); //ASSERT Assert.IsNotNull(v); Assert.IsNotNull(v2); }
public static bool IsValid <T>(this IValidatable <T> entity) { var validator = ValidatorsTable.Get <T>(); return(entity.IsValid(validator)); }