public void TestAbcComparerCompare() { var abcComparer = new AbcComparer(); Assert.True(abcComparer.Compare("abc123", "__AbC_123!") == 0); Assert.True(abcComparer.Compare(null, null) == 0); Assert.True(abcComparer.Compare("abc123", "bcd123") < 0); Assert.True(abcComparer.Compare(null, "bcd123") < 0); Assert.True(abcComparer.Compare("bcd123", "abc123") > 0); Assert.True(abcComparer.Compare("bcd123", null) > 0); }
/// <summary> /// Retrieve the real Property name, if you only have a key whÃch isn't exact /// </summary> /// <param name="possibleProperyName">Possible property name, like without capitals etc</param> /// <returns>The real property name</returns> public string PropertyNameFor(string possibleProperyName) { return(PropertyTypes.Keys.FirstOrDefault(x => AbcComparerInstance.Compare(x, possibleProperyName) == 0)); }