public void ImportPicklist(IList <PicklistLine> pickLines, ScenarioContext scenarioContext) { var picklistId = Guid.NewGuid().ToString().Substring(0, 8); var pickDate = DateTime.Now.ToString("yyyyMMdd"); const string pickTime = "080200"; foreach (var picklistLine in pickLines) { picklistLine.ExtPicklistId = picklistId; picklistLine.ExtOrderId = picklistId; picklistLine.ExtPickDate = pickDate; picklistLine.ExtPickTime = pickTime; } CreateScenarioContextsForPick(pickLines, scenarioContext); var pickData = new ImportPicklist { UniqueMessageId = Guid.NewGuid().ToString(), Lines = pickLines }; var plData = ApiDataFactory.ApiDataFactory.Instance.CreatePicklistAsync(pickData).Result; if (!plData.IsSuccessStatusCode) { Assert.Fail($"The pick order {picklistId} is not created"); } }
public async Task <HttpResponseMessage> CreatePicklistAsync(ImportPicklist picklistData) { var factory = new HttpClientFactory(); using var client = factory.CreateHttpClient(); return(await client.PostAsJsonAsync("/api/PickLists", picklistData)); }