Skip to content

Instantly share code, notes, and snippets.

@bitbonk
Created July 9, 2015 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitbonk/9c465185c8fa186ab16c to your computer and use it in GitHub Desktop.
Save bitbonk/9c465185c8fa186ab16c to your computer and use it in GitHub Desktop.
[TestMethod]
public void AssertNestedInnerException()
{
var expectedExcpetion = new Exception();
new Action(
() =>
{
throw new InvalidOperationException("", new KeyNotFoundException("", expectedExcpetion));
})
.ShouldThrow<InvalidOperationException>()
.WithInnerException<KeyNotFoundException>()
.Which.InnerException.InnerException.Should().Be(expectedExcpetion);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment