public void GetAccessToken_must_return_AcessToken_null_when_parameters_are_invalid() { var target = new APIAuthorizer("client", "key", new Uri("https://www.mystore.com/manager")); Assert.IsNull(target.GetAccessToken(null)); Assert.IsNull(target.GetAccessToken("")); Assert.IsNull(target.GetAccessToken(" { \"token\" : \"value\" }")); }
public void GetAccessToken_must_return_AcessToken_when_parameters_are_valid() { var target = new APIAuthorizer("client", "key", new Uri("https://www.mystore.com/mystore/manager")); var token = "{" + "\"access_token\": \"token\" " + "}"; var result = target.GetAccessToken(token); Assert.AreEqual("token", result.AccessToken); Assert.AreEqual("https://www.mystore.com/mystore/api/v1", result.ApiUrl); }