示例#1
0
 public void ParseInvalidJsonReplyWillThrowException()
 {
     HttpRequestSender provisionerService = new HttpRequestSender();
     provisionerService.ParseResponse("InvalidJson");
 }
示例#2
0
 public void ParseProvisioningResponseTest()
 {
     Provisioner provisioner = Provisioner.ProvisionerInstance;
     HttpRequestSender provisionerService = new HttpRequestSender();
     string json = "{\"sdkEnabled\":true,\"sessionInfo\":{\"key\":\"YN53u9z213mEgAJ\",\"keyIndex\":0}}";
     Dictionary<string, string> provisioningData = provisionerService.ParseResponse(json);
     string expectedKeyValue = "YN53u9z213mEgAJ";
     string actualKeyValue = string.Empty;
     provisioningData.TryGetValue("key", out actualKeyValue);
     Assert.AreEqual(expectedKeyValue, actualKeyValue);
 }