private void ShouldReturnEmptyEnumerableMetadata( PatternMetaProvider patternMetaProvider, RequiredAttribute attribute) { var meta = patternMetaProvider.GetMetadata(attribute).ToArray(); Assert.True(meta.Length == 0); }
private void ShouldReturnMetadata_PatternAttribute( PatternMetaProvider patternMetaProvider, [Frozen] string pattern, RegularExpressionAttribute regExAttribute) { var meta = patternMetaProvider.GetMetadata(regExAttribute).ToArray(); Assert.Contains(meta, mp => { var(key, value) = mp; return(key == "pattern" && (value as string) == pattern); }); }
private void ShouldHandleNullAttribute( PatternMetaProvider patternMetaProvider) { Assert.Throws <ArgumentNullException>(() => patternMetaProvider.GetMetadata(null).ToArray()); }