Skip to content

Commit f5b7747

Browse files
committed
Update tests
1 parent 093d3b6 commit f5b7747

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

BigReal.Tests/BigRealTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ public void ToStringDigitsTest(bool padDecimal) {
1515
decimal testDigits = (decimal)(double.Pi * double.Pow(10.0, exp));
1616
Output.WriteLine(testDigits.ToString());
1717

18-
BigReal bigFloat = new(testDigits);
19-
string str = bigFloat.ToString(100, padDecimal: padDecimal);
18+
BigReal bigReal = new(testDigits);
19+
string str = bigReal.ToString(100, padDecimal: padDecimal);
2020
Output.WriteLine(str);
2121

2222
decimal compare = decimal.Parse(str);
@@ -53,13 +53,13 @@ public void EqualityTest() {
5353
[InlineData(-1.5, -2)]
5454
[InlineData(-2.5, -2)]
5555
public void RoundToEvenTest(double input, double expected) {
56-
BigReal.Round(input, MidpointRounding.ToEven).ShouldBe(expected);
56+
ShouldBeApproximatelyEqual(BigReal.Round(input, MidpointRounding.ToEven), expected);
5757
}
5858
[Theory]
5959
[InlineData(12.34, 1, 12.3)]
6060
[InlineData(12.34, -1, 10)]
6161
public void RoundToDecimalsTest(double input, int digits, double expected) {
62-
BigReal.Round(input, digits).ShouldBe(expected);
62+
ShouldBeApproximatelyEqual(BigReal.Round(input, digits), expected);
6363
}
6464
[Theory]
6565
[InlineData(1)]

0 commit comments

Comments
 (0)