Program.cs 4.5 KB
Newer Older
1
using System;
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
using Test.UtilsTools;
using Cases;

namespace Cases.EntryPoint
{
    class Program
    {

        static void Main(string[] args)
        {
            IntPtr conn = IntPtr.Zero;
            IntPtr stmt = IntPtr.Zero;
            IntPtr res = IntPtr.Zero;

            conn = UtilsTools.TDConnection("127.0.0.1", "root", "taosdata", "", 0);
17 18 19
            UtilsTools.ExecuteUpdate(conn, "drop database if  exists csharp");
            UtilsTools.ExecuteUpdate(conn, "create database if not exists csharp keep 3650");
            UtilsTools.ExecuteUpdate(conn, "use csharp");
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

            Console.WriteLine("====================StableColumnByColumn===================");
            StableColumnByColumn columnByColumn = new StableColumnByColumn();
            columnByColumn.Test(conn, "stablecolumnbycolumn");
            Console.WriteLine("====================StmtStableQuery===================");
            StmtStableQuery stmtStableQuery = new StmtStableQuery();
            stmtStableQuery.Test(conn, "stablecolumnbycolumn");

            Console.WriteLine("====================StableMutipleLine===================");
            StableMutipleLine mutipleLine = new StableMutipleLine();
            mutipleLine.Test(conn, "stablemutipleline");

            //================================================================================

            Console.WriteLine("====================NtableSingleLine===================");
            NtableSingleLine ntableSingleLine = new NtableSingleLine();
            ntableSingleLine.Test(conn, "stablesingleline");
37 38
            IntPtr resPtr = UtilsTools.ExecuteQuery(conn, "select * from stablesingleline ");
            UtilsTools.DisplayRes(resPtr);
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54

            Console.WriteLine("====================NtableMutipleLine===================");
            NtableMutipleLine ntableMutipleLine = new NtableMutipleLine();
            ntableMutipleLine.Test(conn, "ntablemutipleline");
            Console.WriteLine("====================StmtNtableQuery===================");
            StmtNtableQuery stmtNtableQuery = new StmtNtableQuery();
            stmtNtableQuery.Test(conn, "ntablemutipleline");

            Console.WriteLine("====================NtableColumnByColumn===================");
            NtableColumnByColumn ntableColumnByColumn = new NtableColumnByColumn();
            ntableColumnByColumn.Test(conn, "ntablecolumnbycolumn");

            Console.WriteLine("====================fetchfeilds===================");
            FetchFields fetchFields = new FetchFields();
            fetchFields.Test(conn, "fetchfeilds");

55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
           
            StableStmtCases stableStmtCases = new StableStmtCases();
            Console.WriteLine("====================stableStmtCases.TestBindSingleLineCn===================");
            stableStmtCases.TestBindSingleLineCn(conn, "stablestmtcasestestbindsinglelinecn");

            Console.WriteLine("====================stableStmtCases.TestBindColumnCn===================");
            stableStmtCases.TestBindColumnCn(conn, " stablestmtcasestestbindcolumncn");

            Console.WriteLine("====================stableStmtCases.TestBindMultiLineCn===================");
            stableStmtCases.TestBindMultiLineCn(conn, "stablestmtcasestestbindmultilinecn");

            NormalTableStmtCases normalTableStmtCases = new NormalTableStmtCases();
            Console.WriteLine("====================normalTableStmtCases.TestBindSingleLineCn===================");
            normalTableStmtCases.TestBindSingleLineCn(conn, "normaltablestmtcasestestbindsinglelinecn");

            Console.WriteLine("====================normalTableStmtCases.TestBindColumnCn===================");
            normalTableStmtCases.TestBindColumnCn(conn, "normaltablestmtcasestestbindcolumncn");

            Console.WriteLine("====================normalTableStmtCases.TestBindMultiLineCn===================");
            normalTableStmtCases.TestBindMultiLineCn(conn, "normaltablestmtcasestestbindmultilinecn");

76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
            Console.WriteLine("===================JsonTagTest====================");
            JsonTagTest jsonTagTest = new JsonTagTest();
            jsonTagTest.Test(conn);

            Console.WriteLine("====================fetchLengthCase===================");
            FetchLengthCase fetchLengthCase = new FetchLengthCase();
            fetchLengthCase.TestRetrieveBinary(conn);

            UtilsTools.ExecuteQuery(conn, "drop database if  exists csharp");
            UtilsTools.CloseConnection(conn);
            UtilsTools.ExitProgram();
            
        }
    }
}