public void ConvertStringToEnumByXMLAttribute_of_Nonexisting_Enum_without_Attribute_Returns_FirstEnum() { EnumWithAttribute expectedEnum = 0; EnumWithAttribute testEnum = EnumLibrary.ConvertStringToEnumByXMLAttribute <EnumWithAttribute>("nonexistentEnum"); Assert.AreEqual(expectedEnum, testEnum); }
public void TryParseTest(string argument, EnumWithAttribute value, bool canParse) { bool isSuccess = EnumLabel.TryParse(argument, out EnumWithAttribute result); Assert.Equal(canParse, isSuccess); Assert.Equal(value, result); }
public string GetEnumXMLAttribute_of_Enum_with_Attribute_Returns_Matching_Description(EnumWithAttribute enumToCheck) { return(EnumLibrary.GetEnumXMLAttribute(enumToCheck)); }
public void ParseTest(string argument, EnumWithAttribute expected) { Assert.Equal(expected, EnumLabel.Parse <EnumWithAttribute>(argument)); }
public void ToLabelStringTest(EnumWithAttribute argument, string expected) { Assert.Equal(expected, argument.ToLabelString()); }