Files
ClaudeDo/tests/ClaudeDo.Ui.Tests/TestTaskNumbers.cs
T
mika kuns 8da1a12389 fix(test): give Ui.Tests task seeds a unique Number
The task-numbers slice added a UNIQUE index on tasks.number. Ui.Tests seed
TaskEntity rows directly instead of going through TaskRepository, so every row
kept the default Number = 0 and 31 tests failed with
'UNIQUE constraint failed: tasks.number'.
2026-08-11 11:32:01 +02:00

14 lines
472 B
C#

namespace ClaudeDo.Ui.Tests;
/// <summary>
/// Tests seed <see cref="ClaudeDo.Data.Models.TaskEntity"/> rows directly instead of going through
/// TaskRepository, so nothing allocates their Number — and every row would default to 0, colliding
/// on the unique index. Hand out a process-wide unique number instead.
/// </summary>
internal static class TestTaskNumbers
{
private static int _next;
public static int Next() => Interlocked.Increment(ref _next);
}