Skip to content

Commit

Permalink
should throw gives back exception
Browse files Browse the repository at this point in the history
  • Loading branch information
jondot committed Jun 26, 2011
1 parent acd9625 commit a70d5f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Shouldly.Tests/Should.cs
Expand Up @@ -7,7 +7,7 @@ public static class Should
{
public static void Error(Action action, string errorMessage)
{
Shouldly.Should.Throw<ChuckedAWobbly>(action).ShouldBeCloseTo(errorMessage);
Shouldly.Should.Throw<ChuckedAWobbly>(action).Message.ShouldBeCloseTo(errorMessage);
}

public static void NotError(Action action)
Expand Down
4 changes: 2 additions & 2 deletions src/Shouldly/ShouldThrowTestExtensions.cs
Expand Up @@ -7,15 +7,15 @@ namespace Shouldly
[ShouldlyMethods]
public static class Should
{
public static string Throw<TException>(Action actual) where TException : Exception
public static TException Throw<TException>(Action actual) where TException : Exception
{
try
{
actual();
}
catch (TException e)
{
return e.Message;
return e;
}
catch (Exception e)
{
Expand Down

0 comments on commit a70d5f1

Please sign in to comment.