Пример #1
0
        public void Test_DeleteHaveUploadedData()
        {
            var service = new DataService37(ConStr);

            service.SetRemoteConStr(ConStr);
            var id1 = service.CreateBiRecord("ZWX_1", "QSFP28G", "TEST_PLAN", "L10_1", "1");

            var res = service.InsertBiData(id1, new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("a", "1"),
                new KeyValuePair <string, string>("b", "2")
            });

            Assert.AreEqual(res, true);

            var id2 = service.CreateBiRecord("ZWX_2", "QSFP28G", "TEST_PLAN", "L10_1", "1");

            res = service.InsertBiData(id2, new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("a", "1"),
                new KeyValuePair <string, string>("b", "2")
            });

            Assert.AreEqual(res, true);
            service.TransDataToServer();
            DateTime finishTime = DateTime.Now;

            res = service.UpdateBiReocordData(id1, finishTime, "60", "PASS");
            Assert.AreEqual(res, true);
            res = service.UpdateBiReocordData(id2, finishTime, "60", "FAIL");
            Assert.AreEqual(res, true);
            service.TransDataToServer();
            service.DeleteHaveUploadedData(service.DataTables.LocalBiSummaryDataTable);
            service.DeleteHaveUploadedData(service.DataTables.LocalBiDataTable);

            var table = service.FetchLocalUploadData(service.DataTables.LocalBiSummaryDataTable, BurnState.Delete);

            Assert.AreEqual(table.Rows.Count, 0);
            table = service.FetchLocalUploadData(service.DataTables.LocalBiDataTable, BurnState.Delete);
            Assert.AreEqual(table.Rows.Count, 0);
            res = service.DeleteTableData(service.DataTables.LocalBiDataTable);
            Assert.AreEqual(res, true);
            res = service.DeleteTableData(service.DataTables.LocalBiSummaryDataTable);
            Assert.AreEqual(res, true);
            res = service.DeleteTableData(service.DataTables.RemoteBiSummaryDataTable);
            Assert.AreEqual(res, true);
            res = service.DeleteTableData(service.DataTables.RemoteBiDataTable);
            Assert.AreEqual(res, true);
        }
Пример #2
0
        public void Test_TransDataToServer()
        {
            var service = new DataService37(ConStr);

            service.SetRemoteConStr(ConStr);
            var id1 = service.CreateBiRecord("ZWX_1", "QSFP28G", "TEST_PLAN", "L10_1", "1");
            var res = service.InsertBiData(id1, new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("a", "1"),
                new KeyValuePair <string, string>("b", "2")
            });

            Assert.AreEqual(res, true);
            service.TransDataToServer();
            var table = service.FetchLocalUploadData(service.DataTables.LocalBiSummaryDataTable, BurnState.Starting);

            Assert.AreEqual(table.Rows.Count, 1);

            table = service.FetchLocalUploadData(service.DataTables.LocalBiDataTable, BurnState.Delete);
            Assert.AreEqual(table.Rows.Count, 1);
            table = service.FetchLocalUploadData(service.DataTables.RemoteBiSummaryDataTable, BurnState.Created);
            Assert.AreEqual(table.Rows.Count, 1);

            table = service.FetchLocalUploadData(service.DataTables.RemoteBiDataTable, BurnState.Created);
            Assert.AreEqual(table.Rows.Count, 1);


            res = service.DeleteTableData(service.DataTables.LocalBiDataTable);
            Assert.AreEqual(res, true);
            res = service.DeleteTableData(service.DataTables.LocalBiSummaryDataTable);
            Assert.AreEqual(res, true);
            res = service.DeleteTableData(service.DataTables.RemoteBiSummaryDataTable);
            Assert.AreEqual(res, true);
            res = service.DeleteTableData(service.DataTables.RemoteBiDataTable);



            Assert.AreEqual(res, true);
        }