diff --git a/tests/AnthropicClient.Tests/EndToEnd/AnthropicApiClientTests.cs b/tests/AnthropicClient.Tests/EndToEnd/AnthropicApiClientTests.cs index cb1b9fe..1b85111 100644 --- a/tests/AnthropicClient.Tests/EndToEnd/AnthropicApiClientTests.cs +++ b/tests/AnthropicClient.Tests/EndToEnd/AnthropicApiClientTests.cs @@ -687,4 +687,25 @@ public class AnthropicApiClientTests(ConfigurationFixture configFixture) : EndTo result.Value.Id.Should().Be(createResult.Value.Id); result.Value.ProcessingStatus.Should().Be(MessageBatchStatus.Canceling); } + + [Fact] + public async Task CreateFileAsync_WhenCalled_ItShouldReturnResponse() + { + var fileName = "story.txt"; + var fileType = "text/plain"; + var filePath = TestFileHelper.GetTestFilePath("story.txt"); + var fileContent = await File.ReadAllBytesAsync(filePath); + var request = new CreateFileRequest(fileContent, fileName, fileType); + + var httpClient = new HttpClient(); + httpClient.DefaultRequestHeaders.Add("anthropic-beta", "files-api-2025-04-14"); + var client = CreateClient(httpClient); + + var result = await client.CreateFileAsync(request); + + result.IsSuccess.Should().BeTrue(); + result.Value.Should().BeOfType(); + result.Value.Name.Should().Be(fileName); + result.Value.MimeType.Should().Be(fileType); + } } \ No newline at end of file