public void shouldGetOkResponseOnWidgetUrl() { try { Challenger.CSharp.Challenger challenger = new Challenger.CSharp.Challenger(DOMAIN) { ClientId = CLIENT_ID, Key = SECRET_KEY, UseHTTPS = true }; challenger.addParam("param1", "value1"); challenger.addParam("param2", "value2"); String widgetUrl = challenger.getWidgetUrl(); System.Diagnostics.Debug.WriteLine("Widget URl: " + widgetUrl); var httpClient = new HttpClient(); var response = httpClient.GetAsync(widgetUrl).GetAwaiter().GetResult(); var contents = response.Content.ReadAsStringAsync().GetAwaiter().GetResult(); Assert.AreEqual(response.StatusCode, System.Net.HttpStatusCode.OK); Assert.AreNotEqual(contents, "ERROR: decryption error"); } catch (Exception e) { } }
public void shouldRetrieveWidget() { Challenger.CSharp.Challenger challenger = new Challenger.CSharp.Challenger(DOMAIN) { ClientId = CLIENT_ID, Key = SECRET_KEY, UseHTTPS = true }; challenger.addParam("param1", "value1"); challenger.addParam("param2", "value2"); String response = challenger.getWidgetHtml(); // No way to assert, different every time. Paste test output to html and try to open Console.WriteLine(response); System.Diagnostics.Debug.WriteLine(response); }