Added test to check calculated queue position

This commit is contained in:
henry 2025-05-12 01:42:41 -04:00
parent c04a603d56
commit 449b821633
1 changed files with 13 additions and 0 deletions

View File

@ -245,6 +245,19 @@ namespace AccessQueueServiceTests
Assert.Equal(0, response.RequestsAhead); Assert.Equal(0, response.RequestsAhead);
} }
[Fact]
public async Task RequestAccess_ShouldShowCorrectRequestsAhead_WhenAccessRerequested()
{
for (int i = 0; i < CAP_LIMIT + 3; i++)
{
await _accessService.RequestAccess(Guid.NewGuid());
}
var id = Guid.NewGuid();
var response = await _accessService.RequestAccess(id);
Assert.Equal(3, response.RequestsAhead);
response = await _accessService.RequestAccess(id);
Assert.Equal(3, response?.RequestsAhead);
}
} }
} }
} }