private void ShouldReturnEmptyEnumerableMetadata( RequiredMetaProvider patternMetaProvider, RegularExpressionAttribute attribute) { var meta = patternMetaProvider.GetMetadata(attribute).ToArray(); Assert.True(meta.Length == 0); }
private void ShouldReturnMetadata_RequiredAttribute( RequiredMetaProvider patternMetaProvider, RequiredAttribute attribute) { var meta = patternMetaProvider.GetMetadata(attribute).ToArray(); Assert.Contains(meta, mp => { var(key, value) = mp; return(key == "required" && (value as bool?) == true); }); }
private void ShouldHandleNullAttribute( RequiredMetaProvider patternMetaProvider) { Assert.Throws <ArgumentNullException>(() => patternMetaProvider.GetMetadata(null).ToArray()); }