public void ShouldThrowArgumentNullExceptionOnCreateGivenNullOptions() { // Items Needing Cleanup ISQLiteConnection conn = null; try { // Arrange #if __IOS__ ISQLiteConnectionFactoryEx factory = new MvxTouchSQLiteConnectionFactory(); #elif __ANDROID__ ISQLiteConnectionFactoryEx factory = new MvxDroidSQLiteConnectionFactory(); #else ISQLiteConnectionFactoryEx factory = new MvxWpfSqLiteConnectionFactory(); #endif // Act conn = factory.CreateEx(null); } finally // Cleanup in Finally { if (conn != null) // In case test fails and connection was created conn.Close(); } }
public void ShouldThrowArgumentExceptionOnCreateGivenOptionsWithNullAddressAndTypeFile() { // Items Needing Cleanup ISQLiteConnection conn = null; try { // Arrange #if __IOS__ ISQLiteConnectionFactoryEx factory = new MvxTouchSQLiteConnectionFactory(); #elif __ANDROID__ ISQLiteConnectionFactoryEx factory = new MvxDroidSQLiteConnectionFactory(); #else ISQLiteConnectionFactoryEx factory = new MvxWpfSqLiteConnectionFactory(); #endif SQLiteConnectionOptions options = new SQLiteConnectionOptions { Address = null, Type = SQLiteConnectionOptions.DatabaseType.File }; // Act conn = factory.CreateEx(options); } finally // Cleanup in Finally { if (conn != null) // In case test fails and connection was created conn.Close(); } }