Skip to content

Commit

Permalink
Fixes dot numeric separator in tests #1405 (#1424)
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieWhite authored Feb 5, 2023
1 parent bc06ea4 commit 6d0e130
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions docs/CHANGELOG-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ What's changed since v2.7.0:
[#1414](https://github.com/microsoft/PSRule/pull/1414)
- Bump Microsoft.CodeAnalysis.NetAnalyzers to v7.0.0.
[#1374](https://github.com/microsoft/PSRule/pull/1374)
- Bug fixes:
- Fixes handling of numerics in tests for that are impacted by regional format by @BernieWhite.
[#1405](https://github.com/microsoft/PSRule/issues/1405)

## v2.7.0

Expand Down
9 changes: 5 additions & 4 deletions tests/PSRule.Tests/AssertTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ public void Greater()
value = GetObject((name: "value", value: "3"));
Assert.True(assert.Greater(value, "value", 2, convert: true).Result);
Assert.False(assert.Greater(value, "value", 2, convert: false).Result);
value = GetObject((name: "value", value: "4.5"));
value = GetObject((name: "value", value: (4.5).ToString()));
Assert.True(assert.Greater(value, "value", 2, convert: true).Result);
Assert.False(assert.Greater(value, "value", 4, convert: false).Result);

Expand Down Expand Up @@ -883,7 +883,7 @@ public void GreaterOrEqual()
value = GetObject((name: "value", value: "3"));
Assert.True(assert.GreaterOrEqual(value, "value", 2, convert: true).Result);
Assert.False(assert.GreaterOrEqual(value, "value", 2, convert: false).Result);
value = GetObject((name: "value", value: "4.5"));
value = GetObject((name: "value", value: (4.5).ToString()));
Assert.True(assert.GreaterOrEqual(value, "value", 2, convert: true).Result);
Assert.False(assert.GreaterOrEqual(value, "value", 4, convert: false).Result);

Expand Down Expand Up @@ -951,7 +951,8 @@ public void Less()
value = GetObject((name: "value", value: "3"));
Assert.False(assert.Less(value, "value", 2, convert: true).Result);
Assert.True(assert.Less(value, "value", 2, convert: false).Result);
value = GetObject((name: "value", value: "4.5"));
value = GetObject((name: "value", value: (4.5).ToString()));

Assert.False(assert.Less(value, "value", 4, convert: true).Result);
Assert.True(assert.Less(value, "value", 4, convert: false).Result);

Expand Down Expand Up @@ -1019,7 +1020,7 @@ public void LessOrEqual()
value = GetObject((name: "value", value: "3"));
Assert.False(assert.LessOrEqual(value, "value", 2, convert: true).Result);
Assert.True(assert.LessOrEqual(value, "value", 2, convert: false).Result);
value = GetObject((name: "value", value: "4.5"));
value = GetObject((name: "value", value: (4.5).ToString()));
Assert.False(assert.LessOrEqual(value, "value", 4, convert: true).Result);
Assert.True(assert.LessOrEqual(value, "value", 4, convert: false).Result);

Expand Down

0 comments on commit 6d0e130

Please sign in to comment.