diff --git a/dotnet/test/E2E/SessionMcpAndAgentConfigE2ETests.cs b/dotnet/test/E2E/SessionMcpAndAgentConfigE2ETests.cs index 18a8835a6..796c02121 100644 --- a/dotnet/test/E2E/SessionMcpAndAgentConfigE2ETests.cs +++ b/dotnet/test/E2E/SessionMcpAndAgentConfigE2ETests.cs @@ -23,9 +23,7 @@ public async Task Should_Accept_MCP_Server_Configuration_On_Session_Create() await WaitForMcpServerStatusAsync(session, "test-server", McpServerStatus.Connected); // Simple interaction to verify session works - await session.SendAsync(new MessageOptions { Prompt = "What is 2+2?" }); - - var message = await TestHelper.GetFinalAssistantMessageAsync(session); + var message = await session.SendAndWaitAsync(new MessageOptions { Prompt = "What is 2+2?" }); Assert.NotNull(message); Assert.Contains("4", message!.Data.Content); @@ -112,9 +110,7 @@ public async Task Should_Accept_Custom_Agent_Configuration_On_Session_Create() Assert.Matches(@"^[a-f0-9-]+$", session.SessionId); // Simple interaction to verify session works - await session.SendAsync(new MessageOptions { Prompt = "What is 5+5?" }); - - var message = await TestHelper.GetFinalAssistantMessageAsync(session); + var message = await session.SendAndWaitAsync(new MessageOptions { Prompt = "What is 5+5?" }); Assert.NotNull(message); Assert.Contains("10", message!.Data.Content);