I was on the right lines, Assert.Throws actually returns the exception which was thrown.
[Test]
public void CheckForWebFaultException()
{
var myClass = new MyClass();
var ex = Assert.Throws<WebFaultException>(() => myClass.MyMethod());
Assert.AreEqual(HttpStatusCode.NotFound, ex.StatusCode);
}
Note that I've taken out the [ExpectedException(typeof(WebFaultException))]
as the exception is now handled and the test will fail if this is left in.
Assert.Throws
ensures that the exception was thrown by myClass.MyMethod()
and the second assert checks the status code.