public static void Parse_Valid(string value, NumberStyles style, IFormatProvider provider, UIntPtr expected) { UIntPtr result; // Default style and provider if (style == NumberStyles.Integer && provider == null) { Assert.True(UIntPtr.TryParse(value, out result)); Assert.Equal(expected, result); Assert.Equal(expected, UIntPtr.Parse(value)); } // Default provider if (provider == null) { Assert.Equal(expected, UIntPtr.Parse(value, style)); // Substitute default NumberFormatInfo Assert.True(UIntPtr.TryParse(value, style, new NumberFormatInfo(), out result)); Assert.Equal(expected, result); Assert.Equal(expected, UIntPtr.Parse(value, style, new NumberFormatInfo())); } // Default style if (style == NumberStyles.Integer) { Assert.Equal(expected, UIntPtr.Parse(value, provider)); } // Full overloads Assert.True(UIntPtr.TryParse(value, style, provider, out result)); Assert.Equal(expected, result); Assert.Equal(expected, UIntPtr.Parse(value, style, provider)); }
public static UIntPtr Parse(ReadOnlySpan <char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider?provider = null) => UIntPtr.Parse(s, style, provider);
public static UIntPtr Parse(string s, IFormatProvider?provider) => UIntPtr.Parse(s, provider);
public static UIntPtr Parse(string s, NumberStyles style, IFormatProvider?provider) => UIntPtr.Parse(s, style, provider);
public static UIntPtr Parse(string s, NumberStyles style) => UIntPtr.Parse(s, style);
public static UIntPtr Parse(string s) => UIntPtr.Parse(s);