Skip to content

Commit

Permalink
feat(unit-tests): fix unit test
Browse files Browse the repository at this point in the history
This commit fixes a unit test that failed due to cultural differences.
  • Loading branch information
dmitrii-kiselev committed Sep 29, 2024
1 parent 2fd3704 commit caac2df
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1102,8 +1102,7 @@ public void GetInt64_ReturnsExpectedValue(object value, long expected)
new List<object[]>
{
new object[] { null, string.Empty },
new object[] { string.Empty, string.Empty },
new object[] { 123.45, "123,45" }
new object[] { string.Empty, string.Empty }
};

[Theory]
Expand All @@ -1125,6 +1124,24 @@ public void GetString_ReturnsExpectedValue(object value, string expected)
Assert.Equal(expected, actual);
}

[Fact]
public void GetString_ReturnsExpectedValueFromInvariantDecimal()
{
// Arrange
var values = new List<object> { 123.45.ToString(CultureInfo.InvariantCulture) };
var tableRow = new EFTableRow(values);
var tableRows = new EFTableRows { Rows = new List<EFTableRow> { tableRow } };
var dataReader = new EFTableRowsDataReader(tableRows);

dataReader.Read();

// Act
var actual = dataReader.GetString(0);

// Assert
Assert.Equal("123.45", actual);
}

[Fact]
public void GetValue_ReturnsExpectedValue_WhenOrdinalIsValid()
{
Expand Down

0 comments on commit caac2df

Please sign in to comment.