Skip to content

Commit

Permalink
add test case to list submissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathanael Shim authored and Nathanael Shim committed Mar 13, 2024
1 parent 3f61ede commit 0820ecf
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions IndicoV2.IntegrationTests/Submissions/SubmissionClientTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,62 @@ public async Task ListSubmissions_SubmissionFilterUpdatedAt_ShouldFetchSubmissio
}


[Test]
public async Task ListSubmissions_SubmissionOrAndFilter_ShouldFetchSubmissions()
{
// Arrange
var listData = await _dataHelper.Submissions().ListAnyAsync(_workflowId);

var filters = new OrFilter
{
Or = new List<IFilter>
{
new AndFilter
{
And = new List<IFilter>
{
new SubmissionFilter
{
Status = SubmissionStatus.COMPLETE,
},
new SubmissionFilter
{
Retrieved = false,
}
}
},
new AndFilter
{
And = new List<IFilter>
{
new SubmissionFilter
{
Status = SubmissionStatus.FAILED,
},
new SubmissionFilter
{
Retrieved = false,
}
}
}
}
};
// Act
var submissions = await _submissionsClient.ListAsync(null, new List<int> { listData.workflowId }, filters, 0, 10);

submissions.Should().NotBeNull();
submissions.PageInfo.Should().NotBeNull();
submissions.Data.Should().NotBeNull();
foreach (var submission in submissions.Data)
{
submission.Id.Should().BeGreaterThan(0);
submission.Status.Should().BeOfType<SubmissionStatus>();
submission.Status.Should().Match<SubmissionStatus>(status => status == SubmissionStatus.COMPLETE || status == SubmissionStatus.FAILED);
submission.Retrieved.Should().BeFalse();
}
}



[Test]
public async Task GenerateSubmissionResultAsync_ShouldReturnJob()
Expand Down

0 comments on commit 0820ecf

Please sign in to comment.