Esempio n. 1
0
        public void FirstName_ShouldHave_RequiredAttribute()
        {
            Coach  coach    = new Coach();
            string property = "FirstName";

            bool hasAttibute = coach.GetType()
                               .GetProperty(property)
                               .GetCustomAttributes(false)
                               .Where(p => p.GetType() == typeof(RequiredAttribute))
                               .Any();

            Assert.IsTrue(hasAttibute);
        }