예제 #1
0
        public int GetClientIdAndInsertToDB(string clientName, string clientSName, string clientPhone, string clientDescription)
        {
            Client client = new Client()
            {
                client_id          = selectClient.GetNextTabletId(SGetIdFromSpecificTable.queryGetLatestClientID()),
                client_name        = clientName,
                client_sname       = clientSName,
                client_phone       = clientPhone,
                client_description = clientDescription
            };

            return(insertClient.InsertObjectToDB(client));
        }
예제 #2
0
        public void ShouldAddNewClient_ReturnNewID()
        {
            SqlLiteDB.SqlLiteDBCreateTableIFNotExist();
            int    clientID = selectClient.GetNextTabletId(SGetIdFromSpecificTable.queryGetLatestClientID());
            Client client   = new Client()
            {
                client_id          = clientID,
                client_name        = "Julian",
                client_sname       = "Krol",
                client_phone       = "123456789",
                client_description = "test kolejny"
            };
            int lastIndex = addClient.InsertObjectToDB(client);

            Assert.AreEqual(lastIndex, clientID);
        }