feat: implement CreateMessageBatchAsync method

This commit is contained in:
Stevan Freeborn
2025-01-08 20:37:58 -06:00
parent fe39f10382
commit 9548754d6c
9 changed files with 487 additions and 1 deletions
@@ -0,0 +1,36 @@
namespace AnthropicClient.Tests.Unit.Models;
public class MessageBatchRequestItemTests : SerializationTest
{
[Fact]
public void Constructor_WhenCalled_ItShouldReturnInstanceWithPropertiesSet()
{
var customId = "custom_id";
var messageRequest = new MessageRequest();
var result = new MessageBatchRequestItem(customId, messageRequest);
result.Should().BeOfType<MessageBatchRequestItem>();
result.CustomId.Should().Be(customId);
result.Params.Should().BeSameAs(messageRequest);
}
[Theory]
[InlineData("")]
[InlineData(" ")]
[InlineData(null)]
public void Constructor_WhenCalledAndCustomIdIsInvalid_ItShouldThrowException(string? customId)
{
var act = () => new MessageBatchRequestItem(customId!, new MessageRequest());
act.Should().Throw<ArgumentException>();
}
[Fact]
public void Constructor_WhenCalledAndMessageRequestIsNull_ItShouldThrowException()
{
var act = () => new MessageBatchRequestItem("custom_id", null!);
act.Should().Throw<ArgumentException>();
}
}