using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; #if NETFX_CORE using Microsoft.VisualStudio.TestPlatform.UnitTestFramework; #else using NUnit.Framework; #endif namespace SQLite.Tests { public class ExceptionAssert { public static T Throws(Action action) where T : Exception { try { action(); } catch (T ex) { return ex; } Assert.Fail("Expected exception of type {0}.", typeof(T)); return null; } } }