Exemplo n.º 1
0
        public void Bulk_c_UnRegister()
        {
            IBMWIoTP.DeviceListElement [] removeBulk = new IBMWIoTP.DeviceListElement[1];
            var del = new IBMWIoTP.DeviceListElement();

            del.deviceId  = "bulk1";
            del.typeId    = deviceType;
            removeBulk[0] = del;

            var result = client.DeleteMultipleDevices(removeBulk);

            StringAssert.AreEqualIgnoringCase(result[0]["typeId"], deviceType);
            StringAssert.AreEqualIgnoringCase(result[0]["deviceId"], "bulk1");
            Assert.IsTrue(result[0]["success"]);
        }
Exemplo n.º 2
0
        public void DeviceManagementRequests_a_Initiate()
        {
            var testClient = new IBMWIoTP.DeviceManagement("../../Resource/prop.txt", true);

            testClient.connect();
            testClient.manage(4000, true, true, new {});

            IBMWIoTP.DeviceMgmtparameter [] param = new IBMWIoTP.DeviceMgmtparameter[1];
            IBMWIoTP.DeviceMgmtparameter    p     = new IBMWIoTP.DeviceMgmtparameter();
            p.name   = "rebootAfter";
            p.value  = "100";
            param[0] = p;
            IBMWIoTP.DeviceListElement [] deviceList = new IBMWIoTP.DeviceListElement[1];
            IBMWIoTP.DeviceListElement    ele        = new IBMWIoTP.DeviceListElement();
            ele.typeId    = deviceType;
            ele.deviceId  = deviceId;
            deviceList[0] = ele;
            var result = client.InitiateDeviceManagementRequest("device/reboot", param, deviceList);

            dmReqId = result["reqId"];
            Assert.IsNotNullOrEmpty(dmReqId);
        }