public void ParseInvalidJsonReplyWillThrowException()
 {
     HttpRequestSender provisionerService = new HttpRequestSender();
     provisionerService.ParseResponse("InvalidJson");
 }
 public void HTTPRequestFailedWillThrowTimeoutException()
 {
     HttpRequestSender provisionerService = new HttpRequestSender();
     provisionerService.SendAsyncRequest("http://na.widespace.com", TestDelegateMethod3);
 }
 public void SendRequestFuncWillThrowExceptionforInvalidUrl()
 {
     HttpRequestSender provisionerService = new HttpRequestSender();
     provisionerService.SendAsyncRequest("bla bla bla", TestDelegateMethod3);
 }
 public void GetServiceURLWillReturnValidUrl()
 {
     HttpRequestSender provisionerService = new HttpRequestSender();
     string url = UnitTestUtilities.RunInstanceMethod(typeof(HttpRequestSender), "GetServiceURL", provisionerService, new object[] { }).ToString();
     Assert.IsTrue(Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute));
 }
 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);
 }