Skip to content

Commit 5cdad9c

Browse files
test: add edge-case tests for AmountRatioExtensions (block-core#698)
1 parent 97b1c6f commit 5cdad9c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Angor/Avalonia/AngorApp.Tests/Shared/AmountRatioExtensionsTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,14 @@ public void RatioOrZeroAsDouble_should_return_zero_when_denominator_is_zero()
5151

5252
raised.RatioOrZeroAsDouble(target).Should().Be(0d);
5353
}
54+
55+
[Fact]
56+
public void RatioOrZeroAsDouble_should_return_expected_ratio_when_denominator_is_valid()
57+
{
58+
IAmountUI? raised = new AmountUI(25_000_000);
59+
IAmountUI? target = new AmountUI(100_000_000);
60+
61+
raised.RatioOrZeroAsDouble(target).Should().Be(0.25d);
62+
}
5463
}
5564
}

0 commit comments

Comments
 (0)