Пример #1
0
        public void GetEnumPairs_AsDictionary(Type enumType)
        {
            // Act
            Dictionary <string, int> pairs = EnumExts.GetEnumPairs(enumType);

            // Assert
            Assert.Greater(pairs.Count, 0);
            pairs.ForEach(x =>
            {
                Log("{0}: {1}", x.Key, x.Value);
            });
        }
Пример #2
0
 public void ForNonEnumType_GetEnumPairs_ThrowsException()
 {
     // Assert
     Assert.Throws <ArgumentException>(() => EnumExts.GetEnumPairs(typeof(Country)));
 }