public static void runOneRead(Resources context, string filePath, TestType testType, TestWorkload testWorkload, string CustomerAccount, string DataAreaId) { int tryCount = 0; Stopwatch sw = new Stopwatch(); sw.Start(); while (true) { try { tryCount++; CustomerV3 CustomerV3 = context.CustomersV3.Where(x => x.CustomerAccount == CustomerAccount && x.dataAreaId == DataAreaId).First(); break; } catch (Exception e) { if (tryCount >= 3) { throw (e); } sw.Reset(); sw.Start(); } } sw.Stop(); StreamWriter stream = File.AppendText(filePath); stream.WriteLine(Entity + "," + testType + "," + testWorkload + "," + sw.Elapsed.TotalMilliseconds.ToString()); stream.Flush(); stream.Close(); }
public async Task GivenIPostACustomerWithTheGivenNameV3(string givenName) { var customer = new CustomerV3(); customer.GivenName = givenName; customer.FamilyName = "Smith"; customer.PriorityGroups = new List <int> { 1, 3 }; await PostCustomer(customer, Constants.API_VERSION_3); if (_response.IsSuccessStatusCode) { _scenarioContext["CustomerId"] = await _assertionHelper.GetKeyFromResponse("CustomerId", _response); } if (_response.IsSuccessStatusCode) { DeleteRowFromSql("dss-customers", "id", _scenarioContext["CustomerId"] as string); } }