public void ThrowException() { //without generics + if void method Assert.Throws(typeof(Exception), exercise1.ThrowException); //with generics and method isn't void Assert.Throws <Exception>(delegate { exercise1.ThrowException(); }); }