public void HuInvFallback() { var converter = new DecimalConverterAuto(new CultureInfo("hu-HU")); var result = converter.Convert("1.234"); Assert.AreEqual(1.234m, result); }
public void HuEnStringWithThousandsFallbackToInvariant() { var converter = new DecimalConverterAuto(new CultureInfo("hu-HU")); var result = converter.Convert("1,234,456.2"); Assert.AreEqual(1234456.2m, result); }
public void InvInv() { var converter = new DecimalConverterAuto(CultureInfo.InvariantCulture); var result = converter.Convert("1.234"); Assert.AreEqual(1.234m, result); }
public void HuHuThousandsNegBrokenWhiteSpace() { var converter = new DecimalConverterAuto(new CultureInfo("hu-HU")); var result = converter.Convert("- 1 234 456,2"); Assert.AreEqual(null, result); }
public void UsInvBroken() { var converter = new DecimalConverterAuto(new CultureInfo("en-US")); var result = converter.Convert("1.234.456,2"); Assert.AreEqual(null, result); }
public void HuHuPosBrokenWhiteSpace() { var converter = new DecimalConverterAuto(new CultureInfo("hu-HU")); var result = converter.Convert("+ 1,234"); Assert.AreEqual(null, result); }
public void UsInvFallback() { var converter = new DecimalConverterAuto(new CultureInfo("en-US")); var result = converter.Convert("1234456.2"); Assert.AreEqual(1234456.2m, result); }
public void UsUsThousands() { var converter = new DecimalConverterAuto(new CultureInfo("en-US")); var result = converter.Convert("1,234,456.2"); Assert.AreEqual(1234456.2m, result); }
public void InvHuStringWithThousandsBroken() { var converter = new DecimalConverterAuto(CultureInfo.InvariantCulture); var result = converter.Convert("1 234 456,2"); Assert.AreEqual(null, result); }
public void InvHuStringRecognizedThousandSeparator() { var converter = new DecimalConverterAuto(new CultureInfo("hu-HU")); var result = converter.Convert("123,2"); Assert.AreEqual(123.2m, result); }
public void InvHuStringMisrecognizedThousandSeparator() { var converter = new DecimalConverterAuto(CultureInfo.InvariantCulture); var result = converter.Convert("123,2"); Assert.AreEqual(1232.0m, result); }