Skip to content

Commit

Permalink
difference-of-squares: Change expected exception type (exercism#159)
Browse files Browse the repository at this point in the history
* difference-of-squares: Change expected exception type

Change ArgumentException to the more expressive
ArgumentOutOfRangeException.

* difference-of-squares: Update unit test name to reflect changes
  • Loading branch information
balazsbotond authored and robkeim committed Jan 10, 2017
1 parent de0b8e9 commit 14e0ca5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions exercises/difference-of-squares/DifferenceOfSquaresTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public void Test_difference_of_sums_0()

[Ignore("Remove to run test")]
[Test]
public void Test_negative_numbers_throw_argument_exception()
public void Test_negative_numbers_throw_argument_out_of_range_exception()
{
Assert.That(() => new Squares(-5), Throws.TypeOf<ArgumentException>());
Assert.That(() => new Squares(-5), Throws.TypeOf<ArgumentOutOfRangeException>());
}
}
2 changes: 1 addition & 1 deletion exercises/difference-of-squares/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public Squares(int max)
{
if (max < 0)
{
throw new ArgumentException("Max must be positive", "max");
throw new ArgumentOutOfRangeException("Max must be positive", "max");
}

this.max = max;
Expand Down

0 comments on commit 14e0ca5

Please sign in to comment.