public void ColumnsApi_GetAllColumns_Success() { var apiResponse = _columnsApi.GetPAColumnsWithHttpInfo(); Assert.IsTrue(apiResponse.StatusCode == HttpStatusCode.OK, "Response Should be 200 - OK"); Assert.IsInstanceOfType(apiResponse.Data, typeof(Dictionary <string, ColumnSummary>), "Response should be Dictionary of ColumnSummary."); Assert.IsTrue(apiResponse.Data != null, "Response data should not be null."); }
public static string GetRandomColumnId() { var columnsApi = new ColumnsApi(BuildConfiguration(Engine.PA)); ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; var columnsGetAllResponse = columnsApi.GetPAColumnsWithHttpInfo(); var r = new Random(); var randomIndex = r.Next(columnsGetAllResponse.Data.Count); var currentIndex = 0; foreach (var pair in columnsGetAllResponse.Data) { if (currentIndex == randomIndex) { return(pair.Key); } currentIndex++; } return(null); }