private void ShouldThrow(PrivilegedExceptionAction <object> action, Type except) { try { action.Run(); NUnit.Framework.Assert.Fail("action did not throw " + except); } catch (Exception th) { Log.Info("Caught an exception: ", th); Assert.Equal("action threw wrong exception", except, th.GetType ()); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public Object call() throws Exception public virtual Object Call() { return(Action.Run()); }