public void GetEnumFromString_IfEnumValueExists_ReturnsCorrectly <T>(string source, T expected) where T : Enum { var actual = EnumExtension.GetEnumFromString <T>(source); Assert.AreEqual(expected, actual); }
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)); }