Пример #1
0
        public DirtyTrackingTests()
        {
            _api = SQLitePortability.CreateApi();
            _api.Exec("create table foo(id, a, b)");
            _api.Exec("insert into foo values(1, 'initial', 'initial')");

            _bean = _api.Load("foo", 1);

            _api.QueryExecuting += cmd => _queryCount++;
        }
Пример #2
0
        public void DisableImplicitTransactions()
        {
            using (var api = SQLitePortability.CreateApi()) {
                api.EnterFluidMode();
                api.ImplicitTransactions = false;

                var bean = api.Dispense <ThrowingBean>();
                bean.Throw = true;
                try { api.Store(bean); } catch { }

                Assert.Equal(1, api.Count <ThrowingBean>());
            }
        }
Пример #3
0
        public void Regression_NullingExistingProp()
        {
            using (var api = SQLitePortability.CreateApi()) {
                api.EnterFluidMode();

                var bean = api.Dispense("kind1");
                bean["p"] = 123;

                var id = api.Store(bean);

                bean["p"] = null;
                api.Store(bean);

                bean = api.Load("kind1", id);
                Assert.Null(bean["p"]);
            }
        }
Пример #4
0
        public void ApiLink()
        {
            using (var api = SQLitePortability.CreateApi()) {
                api.EnterFluidMode();

                var bean = api.Dispense <ApiLinkChecker>();
                var id   = api.Store(bean);
                Assert.Same(api, bean.Trace["bs"]);
                Assert.Same(api, bean.Trace["as"]);

                bean = api.Load <ApiLinkChecker>(id);
                Assert.Same(api, bean.Trace["bl"]);
                Assert.Same(api, bean.Trace["al"]);

                api.Trash(bean);
                Assert.Same(api, bean.Trace["bt"]);
                Assert.Same(api, bean.Trace["at"]);
            }
        }
Пример #5
0
 public CustomKeysTests()
 {
     _api = SQLitePortability.CreateApi();
 }