コード例 #1
0
        private void ShouldReturnEmptyEnumerableMetadata(
            RequiredMetaProvider patternMetaProvider,
            RegularExpressionAttribute attribute)
        {
            var meta = patternMetaProvider.GetMetadata(attribute).ToArray();

            Assert.True(meta.Length == 0);
        }
コード例 #2
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);
            });
        }
コード例 #3
0
 private void ShouldHandleNullAttribute(
     RequiredMetaProvider patternMetaProvider)
 {
     Assert.Throws <ArgumentNullException>(() => patternMetaProvider.GetMetadata(null).ToArray());
 }