-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRealClaudeIntegrationTests.cs
More file actions
36 lines (30 loc) · 1.24 KB
/
RealClaudeIntegrationTests.cs
File metadata and controls
36 lines (30 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using ManagedCode.ClaudeCodeSharpSDK.Client;
using ManagedCode.ClaudeCodeSharpSDK.Tests.Shared;
namespace ManagedCode.ClaudeCodeSharpSDK.Tests.Integration;
[Property(TestConstants.RequiresClaudeAuthPropertyName, TestConstants.TrueString)]
[RequiresAuthenticatedClaude]
public class RealClaudeIntegrationTests
{
private const string ReplyWithOkOnlyPrompt = "Reply with OK only.";
private static readonly TimeSpan TestTimeout = TimeSpan.FromSeconds(60);
[Test]
public async Task RealClaude_RunAsync_WhenAuthenticated_ReturnsResponse()
{
var (client, settings) = RealClaudeTestSupport.CreateAuthenticatedClient();
using (client)
{
using var thread = client.StartThread(new ThreadOptions
{
Model = settings.Model,
DangerouslySkipPermissions = true,
NoSessionPersistence = true,
});
using var timeoutCts = new CancellationTokenSource(TestTimeout);
var result = await thread.RunAsync(ReplyWithOkOnlyPrompt, new TurnOptions
{
CancellationToken = timeoutCts.Token,
});
await Assert.That(string.IsNullOrWhiteSpace(result.FinalResponse)).IsFalse();
}
}
}