public void DeviceClientObjectCreationWithValues() { Dictionary <string, string> data = IBMWIoTP.DeviceClient.parseFile("../../Resource/prop.txt", "## Device Registration detail"); if (!data.TryGetValue("Organization-ID", out orgId) || !data.TryGetValue("Device-Type", out deviceType) || !data.TryGetValue("Device-ID", out deviceID) || !data.TryGetValue("Authentication-Method", out authmethod) || !data.TryGetValue("Authentication-Token", out authtoken)) { throw new Exception("Invalid property file"); } testClient = new IBMWIoTP.DeviceClient(orgId, deviceType, deviceID, authmethod, authtoken); }
public void DeviceClientAutoReconnect() { IBMWIoTP.DeviceClient.DOMAIN = "its.not.reachable.com"; IBMWIoTP.DeviceClient.MQTTS_PORT = 3000; IBMWIoTP.DeviceClient.AutoReconnect = true; var canceller = new CancellationTokenSource(); Task.Factory.StartNew(() => { System.Threading.Thread.Sleep(1000); IBMWIoTP.DeviceClient.DOMAIN = ".messaging.internetofthings.ibmcloud.com"; IBMWIoTP.DeviceClient.MQTTS_PORT = 8883; System.Threading.Thread.Sleep(3000); testClient.connect(); Assert.IsTrue(testClient.isConnected()); IBMWIoTP.DeviceClient.AutoReconnect = false; canceller.Cancel(); }, canceller.Token); testClient = new IBMWIoTP.DeviceClient("../../Resource/prop.txt"); }
public void DeviceClientObjectCreationQuickStart() { testClient = new IBMWIoTP.DeviceClient("testdev", "12345678"); }
public void DeviceClientObjectCreationWithError() { testClient = new IBMWIoTP.DeviceClient("", "", "", "", ""); }
public void Setup() { IBMWIoTP.DeviceClient.AutoReconnect = false; testClient = new IBMWIoTP.DeviceClient("../../Resource/prop.txt"); }
public void DeviceClientObjectCreationWithFilePathInvaidFile() { testClient = new IBMWIoTP.DeviceClient("../../Resource/propInvalid.txt"); }
public void Setup() { testClient = new IBMWIoTP.DeviceClient("../../Resource/prop.txt"); }