Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

should throw gives back exception

  • Loading branch information...
commit a70d5f16c660d40d6343f97e289995060b1dcf13 1 parent acd9625
@jondot authored
View
2  src/Shouldly.Tests/Should.cs
@@ -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)
View
4 src/Shouldly/ShouldThrowTestExtensions.cs
@@ -7,7 +7,7 @@ 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
{
@@ -15,7 +15,7 @@ public static class Should
}
catch (TException e)
{
- return e.Message;
+ return e;
}
catch (Exception e)
{
Please sign in to comment.
Something went wrong with that request. Please try again.