示例#1
0
        public void GatewayClientObjectCreationWithParams()
        {
            Dictionary <string, string> data = IBMWIoTP.GatewayClient.parseFile("../../Resource/Gatewayprop.txt", "## Gateway 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.GatewayClient(orgId, deviceType, deviceID, authmethod, authtoken);
        }
示例#2
0
        public void DeviceClientObjectCreationWithValuesWithCA()
        {
            Dictionary <string, string> data = IBMWIoTP.GatewayClient.parseFile("../../Resource/Gatewayprop.txt", "## Gateway 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) ||
//	            !data.TryGetValue("CA-Certificate-Path",out caCertificatePath)||
//				!data.TryGetValue("CA-Certificate-Password",out caCertificatePassword)||
                !data.TryGetValue("Client-Certificate-Path", out clientCertificatePath) ||
                !data.TryGetValue("Client-Certificate-Password", out clientCertificatePassword))
            {
                throw new Exception("Invalid property file");
            }
            testClient = new IBMWIoTP.GatewayClient(orgId, deviceType, deviceID, authmethod, authtoken, clientCertificatePath, clientCertificatePassword);
        }
示例#3
0
 public void GatewayClientObjectCreationWithinvalidFilePath()
 {
     testClient = new IBMWIoTP.GatewayClient("propInvalid.text");
 }
示例#4
0
 public void GatewayClientObjectCreationWithFilePath()
 {
     testClient = new IBMWIoTP.GatewayClient("../../Resource/Gatewayprop.txt");
 }
示例#5
0
 public void Setup()
 {
     testClient = new IBMWIoTP.GatewayClient("../../Resource/Gatewayprop.txt");
 }
示例#6
0
 public void Setup()
 {
     IBMWIoTP.GatewayClient.AutoReconnect = false;
     testClient = new IBMWIoTP.GatewayClient("../../Resource/Gatewayprop.txt");
 }