public void SetDealerExperienceBrandUrl(string brandName, string year, string dealerid) { if (stringEqualsIgnoreCase(brandName, Brand.RZR)) { restHelper.SetUrl(string.Concat(UrlBuilder.getRzrLandingPageURL(), string.Format(EndpointString.DEALER_EXPERIENCE_ENDPOINT, year, dealerid))); } else if (stringEqualsIgnoreCase(brandName, Brand.RAN)) { restHelper.SetUrl(string.Concat(UrlBuilder.getRangerLandingPageURL(), string.Format(EndpointString.DEALER_EXPERIENCE_ENDPOINT, year, dealerid))); } else if (stringEqualsIgnoreCase(brandName, Brand.ACE)) { restHelper.SetUrl(string.Concat(UrlBuilder.getAceLandingPageURL(), string.Format(EndpointString.DEALER_EXPERIENCE_ENDPOINT, year, dealerid))); } else if (stringEqualsIgnoreCase(brandName, Brand.GEN)) { restHelper.SetUrl(string.Concat(UrlBuilder.getGeneralLandingPageURL(), string.Format(EndpointString.DEALER_EXPERIENCE_ENDPOINT, year, dealerid))); } else if (stringEqualsIgnoreCase(brandName, Brand.ATV)) { restHelper.SetUrl(string.Concat(UrlBuilder.getSportsmanLandingPageURL(), string.Format(EndpointString.DEALER_EXPERIENCE_ENDPOINT, year, dealerid))); } else { Assert.Fail("Specified brand {0} not found", brandName); } }
public void WhenWeCreateAUser() { var requestBody = new PostUserRequest() { Name = firstName, Job = job }; var request = api.CreatePostRequest <PostUserRequest>(requestBody); var resturl = api.SetUrl("api/users"); var response = api.GetResponse(resturl, request); UserResponse content = api.GetContent <UserResponse>(response); }
public List <string> GetAllModelsColorApiResponse(string brand, string year, string dealerid) { List <string> modelsSeoName = new List <string>(); RestAPIHelper.SetUrl(CPQEndpointBuilder.GetDealerExpModelsEnpointByBrandYear(brand, year, dealerid)); RestAPIHelper.CreateGetRequest(); if (GetResponseStatusCode() == API_SUCCESS_RESPONSE_CODE) { var deserialized = SimpleJson.SimpleJson.DeserializeObject <List <Variant> >(RestAPIHelper.GetResponse().Content); for (int i = 0; i < deserialized.Count; i++) { string fullBuildUrl = deserialized[i].BuildURL; int index = GetNthIndex(fullBuildUrl, '/', 4); string partialBuildUrl = fullBuildUrl.Substring(index + 1); string modelColorUrl = partialBuildUrl.Substring(0, partialBuildUrl.IndexOf("/")); modelsSeoName.Add(modelColorUrl); } } return(modelsSeoName); }
public void GivenIHaveAReqresEndpointApiUsersPage(string endpoint) { RestAPIHelper.SetUrl(endpoint); }
public void GivenIHaveAPostcodeToLookup(string postcode) { RestAPIHelper.SetUrl(postcode); inputPostcodes = postcode; }
public void GivenIHaveAnEndpintEndpoint(string endpoint) { RestAPIHelper.SetUrl(endpoint); }
public void GivenIHaveAEndpointEndpoint(string endpoint) { api.SetUrl(endpoint); }