Skip to content

Commit 7aae48c

Browse files
committed
test: add Divide happy path test to meet 90% coverage threshold
Line coverage was 75% and branch coverage was 50% because the non-zero divisor path in Calculator.Divide was untested. Made-with: Cursor
1 parent 31399e1 commit 7aae48c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/Dotnet.CI.Template.Sample.Tests/UnitTest1.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ public void Add_ShouldReturnSum()
99
Assert.Equal(5, result);
1010
}
1111

12+
[Fact]
13+
public void Divide_ShouldReturnQuotient()
14+
{
15+
int result = Calculator.Divide(10, 2);
16+
Assert.Equal(5, result);
17+
}
18+
1219
[Fact]
1320
public void Divide_ByZero_ShouldThrow()
1421
{

0 commit comments

Comments
 (0)