Exemplo n.º 1
0
        public void ConvertStringToEnumByXMLAttribute_of_Nonexisting_Enum_without_Attribute_Returns_FirstEnum()
        {
            EnumWithAttribute expectedEnum = 0;
            EnumWithAttribute testEnum     = EnumLibrary.ConvertStringToEnumByXMLAttribute <EnumWithAttribute>("nonexistentEnum");

            Assert.AreEqual(expectedEnum, testEnum);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public string GetEnumXMLAttribute_of_Enum_with_Attribute_Returns_Matching_Description(EnumWithAttribute enumToCheck)
 {
     return(EnumLibrary.GetEnumXMLAttribute(enumToCheck));
 }
Exemplo n.º 4
0
 public void ParseTest(string argument, EnumWithAttribute expected)
 {
     Assert.Equal(expected, EnumLabel.Parse <EnumWithAttribute>(argument));
 }
Exemplo n.º 5
0
 public void ToLabelStringTest(EnumWithAttribute argument, string expected)
 {
     Assert.Equal(expected, argument.ToLabelString());
 }