Merge claudedo/113934cda24a4ae99e15d77fca29507e
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using ClaudeDo.Data.Models;
|
||||
using ClaudeDo.Worker.External;
|
||||
using ClaudeDo.Worker.Tests.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace ClaudeDo.Worker.Tests.External;
|
||||
|
||||
public sealed class AppSettingsMcpToolsTests : IDisposable
|
||||
{
|
||||
private readonly DbFixture _db = new();
|
||||
|
||||
public void Dispose() => _db.Dispose();
|
||||
|
||||
[Fact]
|
||||
public async Task GetAppSettings_ReturnsMaxParallelExecutionsFromDb()
|
||||
{
|
||||
using (var ctx = _db.CreateContext())
|
||||
{
|
||||
var row = await ctx.AppSettings.FirstOrDefaultAsync(s => s.Id == AppSettingsEntity.SingletonId)
|
||||
?? throw new InvalidOperationException("Expected seeded app_settings row.");
|
||||
row.MaxParallelExecutions = 3;
|
||||
await ctx.SaveChangesAsync();
|
||||
}
|
||||
|
||||
var sut = new AppSettingsMcpTools(_db.CreateFactory());
|
||||
|
||||
var result = await sut.GetAppSettings(CancellationToken.None);
|
||||
|
||||
Assert.Equal(3, result.MaxParallelExecutions);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user