public static void CanGetProject(IBaseSpaceClient client, string[] includeStrings = null) { var project = CreateRandomTestProject(client); ListProjectsResponse listProjectResponse = client.ListProjects(new ListProjectsRequest() { Limit = 1, Offset = 0, Name = project.Name }); Assert.True(listProjectResponse.Response.Items.Length == 1); var compactProject = listProjectResponse.Response.Items[0]; Assert.True(project.Id == compactProject.Id); Assert.True(project.Name == compactProject.Name); var getProjRequest = new GetProjectRequest(compactProject.Id); if (includeStrings != null && includeStrings.Length > 0) getProjRequest.Include = includeStrings; var getProjectResponse = client.GetProject(new GetProjectRequest(compactProject.Id) { Include = new[] { ProjectIncludes.PERMISSIONS } }); var retrievedProject = getProjectResponse.Response; Assert.True(project.Id == retrievedProject.Id); Assert.True(project.Name == retrievedProject.Name); Assert.True(project.HrefAppResults == retrievedProject.HrefAppResults); Assert.True(project.HrefBaseSpaceUI == retrievedProject.HrefBaseSpaceUI); Assert.True(project.HrefSamples == retrievedProject.HrefSamples); if (includeStrings != null && includeStrings.Length > 0) Assert.NotNull(retrievedProject.Permissions); }
public static AppResult CreateRandomTestAppResult(IBaseSpaceClient client, Project project) { var appResultName = CreateRandomTestAppResultName(); var response = client.CreateAppResult(new CreateAppResultRequest(project.Id, appResultName)); Assert.NotNull(response); Assert.NotNull(response.Response); var appResult = response.Response; Assert.NotNull(appResult); Assert.True(appResult.Name.Contains(appResultName)); return appResult; }
internal static AppSession CreateTestAppSession(IBaseSpaceClient client) { var project = TestHelpers.CreateRandomTestProject(client); var appResult = TestHelpers.CreateRandomTestAppResult(client, project); var appSessionCompact = appResult.AppSession; Assert.NotNull(appSessionCompact); var appSessionResponse = client.GetAppSession(new GetAppSessionRequest(appSessionCompact.Id)); Assert.NotNull(appSessionResponse); var appSession = appSessionResponse.Response; Assert.NotNull(appSession); return appSession; }
public static Project CreateRandomTestProject(IBaseSpaceClient client, string projectName = null) { projectName = projectName ?? CreateRandomTestProjectName(); var response = client.CreateProject(new CreateProjectRequest(projectName)); Assert.NotNull(response); Assert.NotNull(response.ResponseStatus); Assert.Null(response.ResponseStatus.ErrorCode); Assert.NotNull(response.Response); var project = response.Response; Assert.NotNull(project); Assert.True(project.Name.Contains(projectName)); return project; }
internal static AppResult CreateRandomTestAppResult(IBaseSpaceClient client, Project project) { var appResultName = CreateRandomTestAppResultName(); var response = client.CreateAppResult(new PostAppResultRequest(project.Id, appResultName)); Assert.NotNull(response); Assert.NotNull(response.ResponseStatus); Assert.Null(response.ResponseStatus.ErrorCode); Assert.NotNull(response.Response); var appResult = response.Response; Assert.NotNull(appResult); Assert.True(appResult.Name.Contains(appResultName)); return(appResult); }
public static Project CreateRandomTestProject(IBaseSpaceClient client, string projectName = null) { projectName = projectName ?? CreateRandomTestProjectName(); var response = client.CreateProject(new PostProjectRequest(projectName)); Assert.NotNull(response); Assert.NotNull(response.ResponseStatus); Assert.Null(response.ResponseStatus.ErrorCode); Assert.NotNull(response.Response); var project = response.Response; Assert.NotNull(project); Assert.True(project.Name.Contains(projectName)); return(project); }
internal static Sample CreateRandomTestSample(IBaseSpaceClient client, Project project) { /* var sampleName = TestHelpers.CreateRandomTestSampleName(); var response = client.CreateSample(new PostSampleRequest(sampleName)); Assert.NotNull(response); Assert.NotNull(response.ResponseStatus); Assert.Null(response.ResponseStatus.ErrorCode); Assert.NotNull(response.Response); var project = response.Response; Assert.NotNull(project); Assert.True(project.Name.Contains(sampleName)); return project; */ return null; }
internal static Sample CreateRandomTestSample(IBaseSpaceClient client, Project project) { /* * var sampleName = TestHelpers.CreateRandomTestSampleName(); * var response = client.CreateSample(new PostSampleRequest(sampleName)); * Assert.NotNull(response); * Assert.NotNull(response.ResponseStatus); * Assert.Null(response.ResponseStatus.ErrorCode); * * Assert.NotNull(response.Response); * var project = response.Response; * Assert.NotNull(project); * Assert.True(project.Name.Contains(sampleName)); * return project; */ return(null); }
public static void CanGetProject(IBaseSpaceClient client, string[] includeStrings = null) { var project = CreateRandomTestProject(client); ListProjectsResponse listProjectResponse = client.ListProjects(new ListProjectsRequest() { Limit = 1, Offset = 0, Name = project.Name }); Assert.True(listProjectResponse.Response.Items.Length == 1); var compactProject = listProjectResponse.Response.Items[0]; Assert.True(project.Id == compactProject.Id); Assert.True(project.Name == compactProject.Name); var getProjRequest = new GetProjectRequest(compactProject.Id); if (includeStrings != null && includeStrings.Length > 0) { getProjRequest.Include = includeStrings; } var getProjectResponse = client.GetProject(new GetProjectRequest(compactProject.Id) { Include = new[] { ProjectIncludes.PERMISSIONS } }); var retrievedProject = getProjectResponse.Response; Assert.True(project.Id == retrievedProject.Id); Assert.True(project.Name == retrievedProject.Name); Assert.True(project.HrefAppResults == retrievedProject.HrefAppResults); Assert.True(project.HrefBaseSpaceUI == retrievedProject.HrefBaseSpaceUI); Assert.True(project.HrefSamples == retrievedProject.HrefSamples); if (includeStrings != null && includeStrings.Length > 0) { Assert.NotNull(retrievedProject.Permissions); } }
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); }
internal static RunCompact[] ListReadyRuns(IBaseSpaceClient client) { var plannedRuns = client.ListRuns(new ListRunsRequest() {Statuses="Ready"}); return plannedRuns.Response.Items; }
internal static void MarkRunAsReadyToSequence(IBaseSpaceClient client, string plannedRunId) { client.PlannedRunReadyRequest(new PlannedRunReadyRequest(plannedRunId, true)); Assert.Equal(ListReadyRuns(client).Where(r => r.Id == plannedRunId).Count(), 1); }
internal static BiologicalSample CreateBiologicalSample(IBaseSpaceClient client, string sampleId=null, string sampleName=null, string nucleicAcid=null) { var sample = string.Format("sample_SDK_Test_{0}", StringHelpers.RandomAlphanumericString(5)); var biologicalSample = client.CreateBiologicalSample(new CreateBiologicalSampleRequest(sampleId ?? sample, sampleName ?? sample, nucleicAcid ?? "DNA")); Assert.NotNull(biologicalSample.Response); return biologicalSample.Response; }
internal static LibraryContainer CreateContainerLibraries(IBaseSpaceClient client, int libraryCount) { var prepKitIndex = "1"; var originalLibraryCount = libraryCount; var container = CreateLibraryContainer(client); var libraryRequests = new List<SampleLibraryRequest>(); var containerPositions = CreateContainerPositions(); int containerPositionIndex = 0; var project = CreateRandomTestProject(client); var libraryPrep = GetLibraryPrepKit(client, prepKitIndex); while (libraryCount > 0) { var libraryRequest = new SampleLibraryRequest() { BiologicalSampleId = CreateBiologicalSample(client).Id, Index1SequenceId = libraryPrep.Index1Sequences.ElementAt(containerPositionIndex).Id, Position = containerPositions[containerPositionIndex], ProjectId = project.Id }; libraryRequests.Add(libraryRequest); libraryCount--; containerPositionIndex++; } client.CreateOrUpdateContainerLibraries(new CreateOrUpdateContainerLibrariesRequest(libraryRequests, container.Id)); var sampleLibraries = GetSampleLibrariesInContainer(client, container.Id); Assert.Equal(sampleLibraries.Count(), originalLibraryCount); Assert.Equal(sampleLibraries.FirstOrDefault().BiologicalSample.Id, libraryRequests.FirstOrDefault().BiologicalSampleId); return container; }
internal static LibraryContainer CreateLibraryContainer(IBaseSpaceClient client, string libraryPrepId=null, string userContainerId=null, string containerType=null, bool indexByWell=true) { libraryPrepId = libraryPrepId ?? "1"; userContainerId = userContainerId ?? string.Format("container-sdk-{0}", StringHelpers.RandomAlphanumericString(5)); containerType = containerType ?? "Plate96"; indexByWell = indexByWell ? indexByWell : false; var libraryContainer = client.CreateLibraryContainer(new CreateLibraryContainerRequest(libraryPrepId, userContainerId, containerType, indexByWell)); var response = libraryContainer.Response ; Assert.NotNull(response); Assert.Equal(response.UserContainerId, userContainerId); return response; }
internal static LibraryPool CreateLibraryPoolWithMapping(IBaseSpaceClient client, IEnumerable<string>libraryIds, string userPoolId = null) { userPoolId = string.Format("pool-sdk-{0}", StringHelpers.RandomAlphanumericString(5)) ?? userPoolId; var libraryPool = client.CreateLibraryPool(new CreateLibraryPoolRequest(userPoolId, libraryIds)).Response; Assert.NotNull(libraryPool); //client.UpdatePoolToLibraryMapping(new UpdatePoolToLibraryMappingRequest(libraryPool.Id, libraryIds)); return libraryPool; }
internal static PlannedRun CreatePlannedRun(IBaseSpaceClient client, IEnumerable<PlannedRunPoolMapping> poolMappings, int numCyclesRead1, string name=null, string platformName=null, string analysisWorkFlowType=null) { var plannedRun = client.CreatePlannedRun(new CreatePlannedRunRequest( poolMappings, numCyclesRead1, name ?? string.Format("Run-SDK-{0}", StringHelpers.RandomAlphanumericString(5)), platformName ?? "NextSeq", analysisWorkFlowType ?? "HiSeqFastQ", "None" )).Response; Assert.NotNull(plannedRun); return plannedRun; }
internal static LibraryPrepKit GetLibraryPrepKit(IBaseSpaceClient client, string libraryPrepKitId) { var libraryPrepKit = client.GetLibraryPrepKit(new GetLibraryPrepKitIdRequest(libraryPrepKitId)); Assert.NotNull(libraryPrepKit.Response); return libraryPrepKit.Response; }
internal static SampleLibrary[] GetSampleLibrariesInContainer(IBaseSpaceClient client, string containerId) { var sampleLibraries = client.GetContainerToLibraryMapping(new GetContainerToLibraryMappingRequest(containerId)); var response = sampleLibraries.Response; Assert.NotNull(response); Assert.Equal(response.Items.FirstOrDefault().Container.Id, containerId); return response.Items; }