예제 #1
0
        public void ExecuteSelectTableAutoGenerateTest()
        {
            string dbfile = "taskaludb43.sqlite";
            string path   = Path.GetTempPath() + "\\" + dbfile;

            TouchTestDB(dbfile);

            var lt = new ListAutoGenerate();

            lt.Order        = 1;
            lt.Type         = 0;
            lt.Name         = "name";
            lt.Priority     = "";
            lt.Template     = 1;
            lt.Number0      = 0;
            lt.Number1      = 0;
            lt.Checked_date = "2019-02-01 01:23:45";
            SQLiteClass.ExecuteInsertTableAutoGenerate(path, lt);
            var lt2 = new ListAutoGenerate();

            lt2.Order        = 2;
            lt2.Type         = 1;
            lt2.Name         = "name2";
            lt2.Priority     = "";
            lt2.Template     = 1;
            lt2.Number0      = 0;
            lt2.Number1      = 0;
            lt2.Checked_date = "2019-02-01 01:23:45";
            SQLiteClass.ExecuteInsertTableAutoGenerate(path, lt2);

            var aglv   = new AutoGenerateListViewModel();
            var result = SQLiteClass.ExecuteSelectTableAutoGenerate(path, aglv);

            Debug.Assert(result);
            Debug.Assert(aglv.Entries.Count == 2);
        }