public void ConvertNullAPIToSDK() { apiHandover1 = null; converter = new HandoverConverter(apiHandover1); Assert.IsNull(converter.ToAPIHandover()); Assert.IsNull(converter.ToSDKHandover("ko")); }
private OneSpanSign.API.Handover CreateTypicalAPILink() { OneSpanSign.API.Handover apiHandover = new OneSpanSign.API.Handover(); apiHandover.Href = "apiHref"; apiHandover.Title = "apiTitle"; apiHandover.Text = "apiText"; return(apiHandover); }
public void ConvertSDKToAPI() { sdkHandover1 = CreateTypicalSDKHandover(); apiHandover1 = new HandoverConverter(sdkHandover1).ToAPIHandover(); Assert.IsNotNull(apiHandover1); Assert.AreEqual(apiHandover1.Href, sdkHandover1.Href); Assert.AreEqual(apiHandover1.Text, sdkHandover1.Text); Assert.AreEqual(apiHandover1.Title, sdkHandover1.Title); }
public void ConvertAPIToAPI() { apiHandover1 = CreateTypicalAPILink(); apiHandover2 = new HandoverConverter(apiHandover1).ToAPIHandover(); Assert.IsNotNull(apiHandover2); Assert.AreEqual(apiHandover2.Href, apiHandover1.Href); Assert.AreEqual(apiHandover2.Text, apiHandover1.Text); Assert.AreEqual(apiHandover2.Title, apiHandover1.Title); }
public void ConvertAPIToSDK() { apiHandover1 = CreateTypicalAPILink(); sdkHandover1 = new HandoverConverter(apiHandover1).ToSDKHandover(lang); Assert.IsNotNull(sdkHandover1); Assert.AreEqual(sdkHandover1.Language, lang); Assert.AreEqual(sdkHandover1.Href, apiHandover1.Href); Assert.AreEqual(sdkHandover1.Text, apiHandover1.Text); Assert.AreEqual(sdkHandover1.Title, apiHandover1.Title); }
internal OneSpanSign.API.Handover ToAPIHandover() { if (sdkHandover == null) { return(apiHandover); } OneSpanSign.API.Handover result = new OneSpanSign.API.Handover(); result.Href = sdkHandover.Href; result.Text = sdkHandover.Text; result.Title = sdkHandover.Title; return(result); }
public OneSpanSign.API.Handover GetHandoverUrl(string language) { string path = template.UrlFor(UrlTemplate.HANDOVER_URL_PATH) .Replace("{language}", language) .Build(); try { string stringResponse = restClient.Get(path); OneSpanSign.API.Handover apiResponse = JsonConvert.DeserializeObject <OneSpanSign.API.Handover>(stringResponse, jsonSettings); return(apiResponse); } catch (OssServerException e) { throw new OssServerException("Could not get handover url.", e); } catch (Exception e) { throw new OssException("Could not get handover url.", e); } }
public Handover GetHandoverUrl(string language) { OneSpanSign.API.Handover apiHandover = apiClient.GetHandoverUrl(language); return(new HandoverConverter(apiHandover).ToSDKHandover(language)); }
internal HandoverConverter(OneSpanSign.API.Handover apiHandover) { this.apiHandover = apiHandover; }