MockObject mo = MockManager.MockObject(typeof(SqlException)); mock.ExpectAndThrow("MyMethod", (SqlException)mo.Object);