public void FromString(string value, float expected, System.Globalization.NumberFormatInfo numberFormat = null) { if (numberFormat is null) { Assert.Equal(expected, SingleType.FromString(value)); Assert.Equal(expected, SingleType.FromString(value, System.Globalization.NumberFormatInfo.InvariantInfo)); } else { Assert.Equal(expected, SingleType.FromString(value, numberFormat)); } }
public void FromString_ThrowsOverflowException(string value) { Assert.Throws <OverflowException>(() => SingleType.FromString(value)); }
public void FromString_ThrowsInvalidCastException(string value) { Assert.Throws <InvalidCastException>(() => SingleType.FromString(value)); }
public void FromString_Other(string value, float expected) { Assert.Equal(expected, SingleType.FromString(value)); }
public void FromString_NotSupported(string value, float expected) { Assert.Throws <InvalidCastException>(() => SingleType.FromString(value)); }