public void GetEnumFromString_IfEnumValueExists_ReturnsCorrectly <T>(string source, T expected)
            where T : Enum
        {
            var actual = EnumExtension.GetEnumFromString <T>(source);

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
 public static Attribute CreateExtraAttribute(string description, string intentionAsStr)
 {
     try
     {
         var intention = EnumExtension.GetEnumFromString <Intention>(intentionAsStr);
         return(CreateExtraAttribute(description, intention));
     }
     catch (Exception)
     {
         return(null);
     }
 }
 public void GetEnumFromString_IfEnumValueDoesNotExist_ThrowsArgumentException <T>(string source, T expected)
     where T : Enum
 {
     Assert.Catch <ArgumentException>(() => EnumExtension.GetEnumFromString <T>(source));
 }