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'.
14 lines
472 B
C#
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);
|
|
}
|