Skip to content

Instantly share code, notes, and snippets.

@jmkelly
Created November 9, 2016 04:05
Show Gist options
  • Save jmkelly/09d9c7613d407fd9b67877be4fa61815 to your computer and use it in GitHub Desktop.
Save jmkelly/09d9c7613d407fd9b67877be4fa61815 to your computer and use it in GitHub Desktop.
using System;
using System.Threading.Tasks;
using Shouldly;
using Xunit;
namespace ClassLibrary9
{
public class Sample
{
public async Task DoSomething()
{
throw new Exception("test");
}
}
public class TestFixture
{
[Fact]
public void ShouldThrow()
{
var sample = new Sample();
var exception = Should.ThrowAsync<Exception>(() => sample.DoSomething());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment