コード例 #1
0
        public void Should_Match_Property_With_Multiple_ValidatorAttributes()
        {
            var target = new DataAnnotationsValidationPlugin();
            var data = new Data();

            Assert.True(target.Match(new WeakReference(data), nameof(Data.PhoneNumber)));
        }
コード例 #2
0
        public void Should_Not_Match_Property_Without_ValidatorAttribute()
        {
            var target = new DataAnnotationsValidationPlugin();
            var data = new Data();

            Assert.False(target.Match(new WeakReference(data), nameof(Data.Unvalidated)));
        }
コード例 #3
0
        public void Should_Match_Property_With_ValidatorAttribute()
        {
            var target = new DataAnnotationsValidationPlugin();
            var data = new Data();

            Assert.True(target.Match(new WeakReference(data), nameof(Data.Between5And10)));
        }