private async Task <string> BuildRequest(Persistency.Pokemon data, FormUrlEncodedContent content) { if (CheckDataNeedsYodaTranslation(data)) { //yoda translation return(await PostRequest(BASE_YODA_URL, content)); } return(await PostRequest(BASE_SHAKESPEAR_URL, content)); }
private async Task <ResponseDTo> GetResponseDTo(Persistency.Pokemon data) { var values = new Dictionary <string, string> { { "text", data.Description } }; var content = new FormUrlEncodedContent(values); var resultContent = await BuildRequest(data, content); var response = GetResponse <ResponseDTo>(resultContent); return(response); }
private static bool CheckDataNeedsYodaTranslation(Persistency.Pokemon data) { return(data.IsLegendary || data.HabitantType == HabitantType.Cave); }