/// <summary> /// Parse a string value to retrieve an enum value /// </summary> public void TestStaticParse( ) { //Case Sensitive (not found) Assert.IsNull(StringEnum.Parse(typeof(REGISTERS_WithPartialStrings), "RnD sTr") == null); //Case Sensitive (found) Assert.AreEqual(REGISTERS_WithPartialStrings.SP == ( REGISTERS_WithPartialStrings)StringEnum.Parse(typeof(REGISTERS_WithPartialStrings), "RND STR")); //Case insensitive (found) Assert.AreEqual(REGISTERS_WithPartialStrings.SP == (REGISTERS_WithPartialStrings)StringEnum.Parse(typeof(REGISTERS_WithPartialStrings), "RnD sTr", true)); }