Drop the Scene entity/grouping in favor of chapters carrying prose directly and beats belonging to many characters. Add markdown editor + character multi-select components to the web client. Remove all XML doc and inline comments across the touched C#/TS/CSS files in favor of self-documenting names, and record that convention in CLAUDE.md. Add .mcp.json (local MCP server config, no secrets) and ignore .idea/.
37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using Microsoft.Extensions.Logging.Abstractions;
|
|
using Microsoft.Extensions.Options;
|
|
using Novelly.Api.Agent;
|
|
using Novelly.Api.Common;
|
|
|
|
namespace Novelly.Api.Tests;
|
|
|
|
[TestFixture]
|
|
public class AnthropicClientTests
|
|
{
|
|
[Test]
|
|
public void Constructing_without_a_key_does_not_throw() =>
|
|
Assert.That(
|
|
() => new AnthropicAgentModelClient(Options.Create(new AgentOptions()), NullLogger<AnthropicAgentModelClient>.Instance),
|
|
Throws.Nothing);
|
|
|
|
[Test]
|
|
public void Sending_without_a_key_reports_a_configuration_problem()
|
|
{
|
|
var previous = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY");
|
|
Environment.SetEnvironmentVariable("ANTHROPIC_API_KEY", null);
|
|
|
|
try
|
|
{
|
|
var client = new AnthropicAgentModelClient(Options.Create(new AgentOptions()), NullLogger<AnthropicAgentModelClient>.Instance);
|
|
|
|
Assert.That(
|
|
async () => await client.CompleteAsync("system", [], []),
|
|
Throws.TypeOf<AgentNotConfiguredException>().With.Message.Contains("ANTHROPIC_API_KEY"));
|
|
}
|
|
finally
|
|
{
|
|
Environment.SetEnvironmentVariable("ANTHROPIC_API_KEY", previous);
|
|
}
|
|
}
|
|
}
|