public void TestData(string name, JObject data) { _jsc.SetSigningCredentials((string)data["clientID"], (string)data["secret"]); _jsc.SetVersion((string)data["version"]); _jsc.SetTimestamp((int)data["timestamp"]); var user = (JObject)data["user"]; if (user.Count == 0) { _jsc.SetGuest(true); } else { foreach (var entry in user) { _jsc.SetUserField(entry.Key, JsConnectV3.FromJToken(entry.Value)); } } try { var requestUri = new Uri("https://example.com?jwt=" + data[JsConnectV3.FIELD_JWT]); var responseUrl = _jsc.GenerateResponseLocation(requestUri); Assert.False(string.IsNullOrWhiteSpace(data["response"].ToString())); AssertJWTUrlsAreEqual(data["response"].ToString(), responseUrl); } catch (SignatureInvalidException) { Assert.AreEqual("SignatureInvalidException", (data["exception"] ?? "").ToString(), "SignatureInvalidException not expected."); } catch (ExpiredException) { Assert.AreEqual("ExpiredException", (data["exception"] ?? "").ToString(), "ExpiredException not expected."); } }
public void Setup() { _jsc = new JsConnectV3(); }