We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Number converters are using the wrong NumberStyle as Default value. The default constructors need to use the correct NumberStyle.
The following Unit Test must succeed.
public class NegativeValueEntity { public int Value { get; set; } } private class NegativeValueEntityMapping : CsvMapping<NegativeValueEntity> { public NegativeValueEntityMapping() { MapProperty(0, x => x.Value); } } [Test] public void NegativeValueTest() { CsvParserOptions csvParserOptions = new CsvParserOptions(true, new[] { ';' }); CsvReaderOptions csvReaderOptions = new CsvReaderOptions(new[] { Environment.NewLine }); NegativeValueEntityMapping csvMapper = new NegativeValueEntityMapping(); CsvParser<NegativeValueEntity> csvParser = new CsvParser<NegativeValueEntity>(csvParserOptions, csvMapper); var stringBuilder = new StringBuilder() .AppendLine("Value") .AppendLine("-1"); var result = csvParser .ReadFromString(csvReaderOptions, stringBuilder.ToString()) .ToList(); Assert.AreEqual(1, result.Count); Assert.IsTrue(result.All(x => x.IsValid)); Assert.AreEqual(-1, result.First().Result.Value); // Asserts ... }
The text was updated successfully, but these errors were encountered:
Fixing Issue #2
44c0a9d
Switched Default NumberStyles
Issue Testcase added
36cb5c4
Added a Testcase for Issue #2 again.
No branches or pull requests
The Number converters are using the wrong NumberStyle as Default value. The default constructors need to use the correct NumberStyle.
The following Unit Test must succeed.
The text was updated successfully, but these errors were encountered: