Пример #1
0
        private void ShouldReturnEmptyEnumerableMetadata(
            PatternMetaProvider patternMetaProvider,
            RequiredAttribute attribute)
        {
            var meta = patternMetaProvider.GetMetadata(attribute).ToArray();

            Assert.True(meta.Length == 0);
        }
Пример #2
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);
            });
        }
Пример #3
0
 private void ShouldHandleNullAttribute(
     PatternMetaProvider patternMetaProvider)
 {
     Assert.Throws <ArgumentNullException>(() => patternMetaProvider.GetMetadata(null).ToArray());
 }