public void SetFullUri() { var sql = new SQLiteServerConnectionStringBuilder { FullUri = "Bla" }; Assert.AreEqual("Bla", sql.FullUri); }
public void GivenPoolingAsAString() { var sql1 = new SQLiteServerConnectionStringBuilder("pooling=false"); Assert.IsFalse(sql1.Pooling); var sql2 = new SQLiteServerConnectionStringBuilder("Pooling=true"); Assert.IsTrue(sql2.Pooling); }
public void ReadOnlyGivenAsANumber() { var sql1 = new SQLiteServerConnectionStringBuilder("Read Only=0"); Assert.IsFalse(sql1.ReadOnly); var sql2 = new SQLiteServerConnectionStringBuilder("Read Only=1"); Assert.IsTrue(sql2.ReadOnly); }
public void GivenUseUTF16EncodingAsAString() { var sql1 = new SQLiteServerConnectionStringBuilder("useutf16encoding=false"); Assert.IsFalse(sql1.UseUTF16Encoding); var sql2 = new SQLiteServerConnectionStringBuilder("useutf16encoding=true"); Assert.IsTrue(sql2.UseUTF16Encoding); }
public void GivenUseUTF16EncodingAsANumber() { var sql1 = new SQLiteServerConnectionStringBuilder("useutf16encoding=0"); Assert.IsFalse(sql1.UseUTF16Encoding); var sql2 = new SQLiteServerConnectionStringBuilder("useutf16encoding=1"); Assert.IsTrue(sql2.UseUTF16Encoding); var sql3 = new SQLiteServerConnectionStringBuilder("useutf16encoding=1234"); Assert.IsTrue(sql3.UseUTF16Encoding); }
public void GivenPoolingAsANumber() { var sql1 = new SQLiteServerConnectionStringBuilder("Pooling=0"); Assert.IsFalse(sql1.Pooling); var sql2 = new SQLiteServerConnectionStringBuilder("pooling=1"); Assert.IsTrue(sql2.Pooling); var sql3 = new SQLiteServerConnectionStringBuilder("pooling=1234"); Assert.IsTrue(sql3.Pooling); }
/// <inheritdoc /> public Task <ISQLiteServerConnectionWorker> OpenAsync(string connectionString, CancellationToken cancellationToken) { // sanity check ThrowIfDisposed(); // parse the connection string var builder = new SQLiteServerConnectionStringBuilder(connectionString); // we are now connected, (otherwise we would have thrown). // so we can now create the required worker. ISQLiteServerConnectionWorker worker; if (_connectionController.Server) { worker = new SQLiteServerConnectionServerWorker(connectionString, _connectionController, builder.DefaultTimeout); return(Task.FromResult(worker)); } _connectionController.OnServerDisconnect += OnServerDisconnect; worker = new SQLiteServerConnectionClientWorker(connectionString, _connectionController, builder.DefaultTimeout); return(Task.FromResult(worker)); }
public void DefaultFullUri() { var sql = new SQLiteServerConnectionStringBuilder(); Assert.AreEqual(null, sql.FullUri); }
public void DefaultDataSource() { var sql = new SQLiteServerConnectionStringBuilder(); Assert.AreEqual("", sql.DataSource); }
public void SetPasswordInConnectionString() { var sql = new SQLiteServerConnectionStringBuilder("Password=xyz"); Assert.AreEqual("xyz", sql.Password); }
public void GivenUriInConnectionString() { var sql = new SQLiteServerConnectionStringBuilder("Uri=Bla"); Assert.AreEqual("Bla", sql.Uri); }
public void InvalidVersionGivenByConnectionString() { var sql = new SQLiteServerConnectionStringBuilder("Version=2"); Assert.AreEqual(2, sql.Version); }
public void DefaultPassword() { var sql = new SQLiteServerConnectionStringBuilder(); Assert.AreEqual("", sql.Password); }
public void GetTheBusyTimeOutGivenInConnectionString() { var sql = new SQLiteServerConnectionStringBuilder("BusyTimeout=60"); Assert.AreEqual(60, sql.BusyTimeout); }
public void IsNotReadOnlyByDefault() { var sql = new SQLiteServerConnectionStringBuilder(); Assert.IsFalse(sql.ReadOnly); }
public void DefaultSynchronousMode() { var sql = new SQLiteServerConnectionStringBuilder(); Assert.AreEqual(SynchronizationModes.Normal, sql.SyncMode); }
public void GetTheBusyTimeOutDefaultValue() { var sql = new SQLiteServerConnectionStringBuilder(); Assert.AreEqual(0, sql.BusyTimeout); }
public void DefaultVersion() { var sql = new SQLiteServerConnectionStringBuilder(); Assert.AreEqual(3, sql.Version); }
public void GivenSynchronousMode() { var sql = new SQLiteServerConnectionStringBuilder("Synchronous=Full"); Assert.AreEqual(SynchronizationModes.Full, sql.SyncMode); }
public void UPoolingDefaultValue() { var sql = new SQLiteServerConnectionStringBuilder(); Assert.IsFalse(sql.Pooling); }
public void InvalidSynchronousModeIsDefault() { var sql = new SQLiteServerConnectionStringBuilder("Synchronous=BlahBlah"); Assert.AreEqual(SynchronizationModes.Normal, sql.SyncMode); }
public void UseUTF16EncodingDefaultValue() { var sql = new SQLiteServerConnectionStringBuilder(); Assert.IsFalse(sql.UseUTF16Encoding); }