Skip to content

Commit a62542a

Browse files
committed
Added missing unit tests for Throw.When(bool, Func<Exception>)
1 parent 5e0c995 commit a62542a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Pitcher.Tests/ThrowTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,17 @@ public void When_ConditionFalse_DoesNotThrow()
2222
{
2323
Throw.When(false, new Exception());
2424
}
25+
26+
[Fact]
27+
public void WhenFactory_ConditionTrue_Throws()
28+
{
29+
Assert.ThrowsAny<Exception>(() => Throw.When(true, () => new Exception()));
30+
}
31+
32+
[Fact]
33+
public void WhenFactory_ConditionFalse_DoesNotThrow()
34+
{
35+
Throw.When(false, () => new Exception());
36+
}
2537
}
2638
}

0 commit comments

Comments
 (0)