From 779a5ca2818e79081cbd9a8fab4a7cbb7b4e0222 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:33:27 -0600 Subject: [PATCH] tests: add end-to-end test for creating a message batch --- .../EndToEnd/AnthropicApiClientTests.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/AnthropicClient.Tests/EndToEnd/AnthropicApiClientTests.cs b/tests/AnthropicClient.Tests/EndToEnd/AnthropicApiClientTests.cs index 47ccadd..2fff56f 100644 --- a/tests/AnthropicClient.Tests/EndToEnd/AnthropicApiClientTests.cs +++ b/tests/AnthropicClient.Tests/EndToEnd/AnthropicApiClientTests.cs @@ -341,4 +341,24 @@ public class ClientTests(ConfigurationFixture configFixture) : EndToEndTest(conf result.Value.Should().BeOfType(); result.Value.Id.Should().Be(AnthropicModels.Claude3Haiku); } + + [Fact] + public async Task CreateMessageBatchAsync_WhenCalled_ItShouldReturnResponse() + { + var request = new MessageBatchRequest([ + new( + Guid.NewGuid().ToString(), + new( + model: AnthropicModels.Claude3Haiku, + messages: [new(MessageRole.User, [new TextContent("Hello!")])] + ) + ), + ]); + + var result = await _client.CreateMessageBatchAsync(request); + + result.IsSuccess.Should().BeTrue(); + result.Value.Should().BeOfType(); + result.Value.Id.Should().NotBeNullOrEmpty(); + } } \ No newline at end of file