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(); } } }
public ISQLiteConnection CreateEx(string address, SQLiteConnectionOptions options = null) { options = options ?? new SQLiteConnectionOptions(); var path = options.BasePath ?? Directory.GetCurrentDirectory(); var filePath = Path.Combine(path, address); return new SQLiteConnection(filePath, SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create, options.StoreDateTimeAsTicks); }
public ISQLiteConnection CreateEx(string address, SQLiteConnectionOptions options = null) { options = options ?? new SQLiteConnectionOptions(); var path = options.BasePath ?? string.Empty; var filePath = Path.Combine(path, address); return new SQLiteConnection(filePath, options.StoreDateTimeAsTicks); }
public ISQLiteConnection CreateEx(string address, SQLiteConnectionOptions options = null) { options = options ?? new SQLiteConnectionOptions(); var path = options.BasePath ?? Windows.Storage.ApplicationData.Current.LocalFolder.Path; var filePath = Path.Combine(path, address); return new SQLiteConnection(filePath, SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create, options.StoreDateTimeAsTicks); }
public ISQLiteConnection CreateEx(string address, SQLiteConnectionOptions options = null) { options = options ?? new SQLiteConnectionOptions(); var path = options.BasePath ?? Environment.GetFolderPath(Environment.SpecialFolder.Personal);Environment.GetFolderPath(Environment.SpecialFolder.Personal); var filePath = Path.Combine(path, address); return new SQLiteConnection(filePath, options.StoreDateTimeAsTicks); }
public ISQLiteConnectionWithLock GetConnection(string address, SQLiteConnectionOptions options = null) { options = options ?? new SQLiteConnectionOptions(); var path = options.BasePath ?? Windows.Storage.ApplicationData.Current.LocalFolder.Path; var filePath = Path.Combine(path, address); return(this.GetConnection(new SQLiteConnectionString(filePath, SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create, options.StoreDateTimeAsTicks))); }
public ISQLiteConnection CreateEx(string address, SQLiteConnectionOptions options = null) { options = options ?? new SQLiteConnectionOptions(); var path = options.BasePath ?? ApplicationData.Current.LocalFolder.Path; var filePath = Path.Combine(path, address); return(new SQLiteConnection(filePath, options.StoreDateTimeAsTicks)); }
public ISQLiteConnection CreateEx(string address, SQLiteConnectionOptions options = null) { options = options ?? new SQLiteConnectionOptions(); var path = options.BasePath ?? Directory.GetCurrentDirectory(); var filePath = Path.Combine(path, address); return(new SQLiteConnection(filePath, SQLiteOpenFlags.ReadWrite | SQLiteOpenFlags.Create, options.StoreDateTimeAsTicks)); }
public ISQLiteConnectionWithLock GetConnection(string address, SQLiteConnectionOptions options = null) { options = options ?? new SQLiteConnectionOptions(); var path = options.BasePath ?? Environment.GetFolderPath(Environment.SpecialFolder.Personal); var filePath = Path.Combine(path, address); return(this.GetConnection(new SQLiteConnectionString(filePath, options.StoreDateTimeAsTicks))); }
public ISQLiteConnection CreateEx(string address, SQLiteConnectionOptions options = null) { options = options ?? new SQLiteConnectionOptions(); var path = options.BasePath ?? string.Empty; var filePath = Path.Combine(path, address); return(new SQLiteConnection(filePath, options.StoreDateTimeAsTicks)); }
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(); } }
private ISQLiteConnection CreateTempDb(SQLiteConnectionOptions options) { return new SQLiteConnection(string.Empty, new SQLiteConnectionOptions().StoreDateTimeAsTicks); }
private ISQLiteConnection CreateTempDb(SQLiteConnectionOptions options) { return(new SQLiteConnection(string.Empty, new SQLiteConnectionOptions().StoreDateTimeAsTicks)); }