public void NumericUtility_TryParseUInt64_1() { ulong value; Assert.IsTrue(NumericUtility.TryParseUInt64("123", out value)); Assert.AreEqual(123u, value); Assert.IsFalse(NumericUtility.TryParseUInt64("hello", out value)); Assert.IsFalse(NumericUtility.TryParseUInt64(string.Empty, out value)); Assert.IsFalse(NumericUtility.TryParseUInt64(null, out value)); }
public static ulong GetUInt64 ( [NotNull] string key, ulong defaultValue ) { string s = CM.AppSettings[key]; if (!NumericUtility.TryParseUInt64(s, out ulong result)) { result = defaultValue; } return(result); }
public static ulong GetUInt64 ( [NotNull] string key, ulong defaultValue ) { #if DROID || ANDROID || UAP return(defaultValue); #else ulong result; string s = CM.AppSettings[key]; if (!NumericUtility.TryParseUInt64(s, out result)) { result = defaultValue; } return(result); #endif }