Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove async processing test from TestUtilitiesIntegrationTests
Removed the test for async processing in MockTransport.
  • Loading branch information
m-redding authored Sep 18, 2025
commit a07315d081f5d1536829a670834d15b2b3cf3f39
Original file line number Diff line number Diff line change
Expand Up @@ -122,51 +122,6 @@ public async Task CompleteRequestResponseCycleWithAllMockComponentsWorksEndToEnd
}
}

[Test]
public async Task MockTransportWithAsyncProcessingHandlesAsyncOperationsCorrectly()
{
var processedItems = new List<string>();
var transport = new MockPipelineTransport(msg =>
{
processedItems.Add($"Processed: {msg.Request.Method} {msg.Request.Uri}");
return new MockPipelineResponse(200, "OK").WithContent("async response");
});
transport.ExpectSyncPipeline = false; // Enable async processing

var messages = new[]
{
CreateMessageWithUrl(transport, "GET", "https://api.example.com/item/1"),
CreateMessageWithUrl(transport, "GET", "https://api.example.com/item/2"),
CreateMessageWithUrl(transport, "GET", "https://api.example.com/item/3")
};

var tasks = messages.Select(async msg =>
{
await Task.Delay(10); // Simulate some async work
await transport.ProcessAsync(msg);
return msg;
});

var results = await Task.WhenAll(tasks);

using (Assert.EnterMultipleScope())
{
Assert.That(results.Length, Is.EqualTo(3));
Assert.That(processedItems.Count, Is.EqualTo(3));
Assert.That(transport.Requests.Count, Is.EqualTo(3));
}

foreach (var result in results)
{
Assert.That(result.Response, Is.Not.Null);
using (Assert.EnterMultipleScope())
{
Assert.That(result.Response.Status, Is.EqualTo(200));
Assert.That(result.Response.Content.ToString(), Is.EqualTo("async response"));
}
}
}

[Test]
public void MockTransportWithSyncAsyncMismatchThrowsAppropriateExceptions()
{
Expand Down