public static void CanGetUserProjectsFirstPage(IBaseSpaceClient client, string[] includeStrings = null) { var getListProjsRequest = new ListProjectsRequest(); if (includeStrings != null && includeStrings.Length > 0) { getListProjsRequest.Include = includeStrings; } ListProjectsResponse response = client.ListProjects(getListProjsRequest); Assert.NotNull(response); Assert.True(response.Response.TotalCount > 0); //make sure account has at least 1 for access token ProjectCompact projectResult = response.Response.Items[0]; Assert.NotNull(projectResult); Assert.NotEmpty(projectResult.Id); Assert.NotEmpty(projectResult.Name); Assert.NotSame(projectResult.Id, projectResult.Name); Assert.True(projectResult.DateCreated > new DateTime(2009, 1, 1)); if (includeStrings != null && includeStrings.Length > 0) { Assert.NotNull(projectResult.Permissions); } }
public void CanGetUserProjectsFirstPage() { ListProjectsResponse response = Client.ListProjects(new ListProjectsRequest()); Assert.NotNull(response); Assert.True(response.Response.TotalCount > 0); //make sure account has at least 1 for access token ProjectCompact projectResult = response.Response.Items[0]; Assert.NotNull(projectResult); Assert.NotEmpty(projectResult.Id); Assert.NotEmpty(projectResult.Name); Assert.NotSame(projectResult.Id, projectResult.Name); Assert.True(projectResult.DateCreated > new DateTime(2009, 1, 1)); }
public void CanGetUserProjectsFirstPageAsync() { Task <ListProjectsResponse> asyncResponse = Client.ListProjectsAsync(new ListProjectsRequest()); asyncResponse.Wait(TimeSpan.FromMinutes(1)); var response = asyncResponse.Result; Assert.NotNull(response); Assert.True(response.Response.TotalCount > 0); //make sure account has at least 1 for access token ProjectCompact projectResult = response.Response.Items[0]; Assert.NotNull(projectResult); Assert.IsNotNull(projectResult.Id); Assert.IsNotNull(projectResult.Name); Assert.IsNotNull(projectResult.Id, projectResult.Name); Assert.True(projectResult.DateCreated > new DateTime(2009, 1, 1)); }