예제 #1
0
        public void SetFullUri()
        {
            var sql = new SQLiteServerConnectionStringBuilder
            {
                FullUri = "Bla"
            };

            Assert.AreEqual("Bla", sql.FullUri);
        }
예제 #2
0
        public void GivenPoolingAsAString()
        {
            var sql1 = new SQLiteServerConnectionStringBuilder("pooling=false");

            Assert.IsFalse(sql1.Pooling);

            var sql2 = new SQLiteServerConnectionStringBuilder("Pooling=true");

            Assert.IsTrue(sql2.Pooling);
        }
예제 #3
0
        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);
        }
예제 #4
0
        public void GivenUseUTF16EncodingAsAString()
        {
            var sql1 = new SQLiteServerConnectionStringBuilder("useutf16encoding=false");

            Assert.IsFalse(sql1.UseUTF16Encoding);

            var sql2 = new SQLiteServerConnectionStringBuilder("useutf16encoding=true");

            Assert.IsTrue(sql2.UseUTF16Encoding);
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        /// <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));
        }
예제 #8
0
        public void DefaultFullUri()
        {
            var sql = new SQLiteServerConnectionStringBuilder();

            Assert.AreEqual(null, sql.FullUri);
        }
예제 #9
0
        public void DefaultDataSource()
        {
            var sql = new SQLiteServerConnectionStringBuilder();

            Assert.AreEqual("", sql.DataSource);
        }
예제 #10
0
        public void SetPasswordInConnectionString()
        {
            var sql = new SQLiteServerConnectionStringBuilder("Password=xyz");

            Assert.AreEqual("xyz", sql.Password);
        }
예제 #11
0
        public void GivenUriInConnectionString()
        {
            var sql = new SQLiteServerConnectionStringBuilder("Uri=Bla");

            Assert.AreEqual("Bla", sql.Uri);
        }
예제 #12
0
        public void InvalidVersionGivenByConnectionString()
        {
            var sql = new SQLiteServerConnectionStringBuilder("Version=2");

            Assert.AreEqual(2, sql.Version);
        }
예제 #13
0
        public void DefaultPassword()
        {
            var sql = new SQLiteServerConnectionStringBuilder();

            Assert.AreEqual("", sql.Password);
        }
예제 #14
0
        public void GetTheBusyTimeOutGivenInConnectionString()
        {
            var sql = new SQLiteServerConnectionStringBuilder("BusyTimeout=60");

            Assert.AreEqual(60, sql.BusyTimeout);
        }
예제 #15
0
        public void IsNotReadOnlyByDefault()
        {
            var sql = new SQLiteServerConnectionStringBuilder();

            Assert.IsFalse(sql.ReadOnly);
        }
예제 #16
0
        public void DefaultSynchronousMode()
        {
            var sql = new SQLiteServerConnectionStringBuilder();

            Assert.AreEqual(SynchronizationModes.Normal, sql.SyncMode);
        }
예제 #17
0
        public void GetTheBusyTimeOutDefaultValue()
        {
            var sql = new SQLiteServerConnectionStringBuilder();

            Assert.AreEqual(0, sql.BusyTimeout);
        }
예제 #18
0
        public void DefaultVersion()
        {
            var sql = new SQLiteServerConnectionStringBuilder();

            Assert.AreEqual(3, sql.Version);
        }
예제 #19
0
        public void GivenSynchronousMode()
        {
            var sql = new SQLiteServerConnectionStringBuilder("Synchronous=Full");

            Assert.AreEqual(SynchronizationModes.Full, sql.SyncMode);
        }
예제 #20
0
        public void UPoolingDefaultValue()
        {
            var sql = new SQLiteServerConnectionStringBuilder();

            Assert.IsFalse(sql.Pooling);
        }
예제 #21
0
        public void InvalidSynchronousModeIsDefault()
        {
            var sql = new SQLiteServerConnectionStringBuilder("Synchronous=BlahBlah");

            Assert.AreEqual(SynchronizationModes.Normal, sql.SyncMode);
        }
예제 #22
0
        public void UseUTF16EncodingDefaultValue()
        {
            var sql = new SQLiteServerConnectionStringBuilder();

            Assert.IsFalse(sql.UseUTF16Encoding);
        }