Пример #1
0
        public void HaveRequiredAttribute()
        {
            var rim = new RimWithTire();

            var result = rim
                         .GetType()
                         .GetProperty("CentralHoleSize")
                         .GetCustomAttributes(false)
                         .Where(x => x.GetType() == typeof(System.ComponentModel.DataAnnotations.RequiredAttribute))
                         .Any();

            Assert.True(result);
        }
Пример #2
0
        public void HaveStringLengthAttributeAttribute()
        {
            var bm = new RimWithTire();

            var result = bm
                         .GetType()
                         .GetProperty("WeightIndex")
                         .GetCustomAttributes(false)
                         .Where(x => x.GetType() == typeof(System.ComponentModel.DataAnnotations.StringLengthAttribute))
                         .Any();

            Assert.True(result);
        }
Пример #3
0
        public void HaveRangeAttribute()
        {
            var rim = new RimWithTire();

            var result = rim
                         .GetType()
                         .GetProperty("SpaceBetweenBolts")
                         .GetCustomAttributes(false)
                         .Where(x => x.GetType() == typeof(System.ComponentModel.DataAnnotations.RangeAttribute))
                         .Any();

            Assert.True(result);
        }