Exemple #1
0
        public static void test_pkg_serialize()
        {
            DataBase.Account account = new Account();
            account.guid = "guillllll";
            account.user = "******";
            account.psw = "fjsadlkf";
            account.roles = new List<int>();
            for (int i=0;i<4;++i)
            {
                account.roles.Add(i);
            }
            account.test = 45;
            account.active_role = account.roles[0];

            string conent = DBSerializer.serializePKG(account);
            DataBase.Account res = (DataBase.Account)DBSerializer.deserializePKG(conent);
            System.Diagnostics.Debug.Assert(res.test == 45);
            System.Diagnostics.Debug.Assert(res.psw == "fjsadlkf");
        }
Exemple #2
0
 public static void test_deserialize_from_sql_record()
 {
     string[] arr = new string[] { "123","111111","","5","","JKKKKKKKKKKKKJKLLJLK" };
     Account acc = new Account();
     DBSerializer.deserializePKGFromSQL(arr, acc);
 }
Exemple #3
0
 public static void test_create_and_insertto_db()
 {
     DataBase.Account account = new Account();
     account.createAndInsertToDB();
 }