Skip to content

Commit

Permalink
Merge pull request #408 from TaffarelJr/master
Browse files Browse the repository at this point in the history
Include customMessage in ShouldNotBeAssignableTo(...)
  • Loading branch information
josephwoodward committed Oct 13, 2016
2 parents f5bf810 + a2fb304 commit 12f0f7d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/Shouldly.Tests/ShouldNotBeAssignableTo/BasicTypesScenario.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ public void BasicTypesScenarioShouldFail()
should not be assignable to
System.Int32
but was
2",
2
Additional Info:
Some additional context",

errorWithoutSource:
@"2
should not be assignable to
System.Int32
but was");
but was
Additional Info:
Some additional context");
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ public void DerivedTypeScenarioShouldFail()
should not be assignable to
Shouldly.Tests.TestHelpers.MyThing
but was
Shouldly.Tests.TestHelpers.MyThing (000000)",
Shouldly.Tests.TestHelpers.MyThing (000000)
Additional Info:
Some additional context",

errorWithoutSource:
@"Shouldly.Tests.TestHelpers.MyThing (000000)
should not be assignable to
Shouldly.Tests.TestHelpers.MyThing
but was");
but was
Additional Info:
Some additional context");
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static void ShouldNotBeAssignableTo(this object actual, Type expected, st

public static void ShouldNotBeAssignableTo(this object actual, Type expected, [InstantHandle] Func<string> customMessage)
{
actual.AssertAwesomely(v => !Is.InstanceOf(v, expected), actual, expected);
actual.AssertAwesomely(v => !Is.InstanceOf(v, expected), actual, expected, customMessage);
}

public static void ShouldNotBeOfType<T>(this object actual)
Expand Down Expand Up @@ -125,6 +125,6 @@ public static void ShouldNotBeOfType(this object actual, Type expected, string c
public static void ShouldNotBeOfType(this object actual, Type expected, [InstantHandle] Func<string> customMessage)
{
actual.AssertAwesomely(v => v == null || v.GetType() != expected, actual, expected, customMessage);
}
}
}
}

0 comments on commit 12f0f7d

Please sign in to comment.