public override bool IsValid(object value)
 {
     return(Type.GetFields(Public | Static).Any(m =>
     {
         var enumeration = (Enumeration)m.GetValue(null);
         return enumeration != null && enumeration.Id == (int)value && ValueList.Contains(m.Name);
     }));
 }
Exemplo n.º 2
0
        public static void ContainsTest()
        {
            var valueList = new ValueList <int>(new int[] { 1, 2, 3 });

            Assert.That(() => valueList.Contains(1),
                        Is.True
                        );

            Assert.That(() => valueList.Contains(4),
                        Is.False
                        );

            valueList = new ValueList <int>();

            Assert.That(() => valueList.Contains(0),
                        Is.False
                        );
        }