Files
Chronos/tests/Chronos.Data.Tests/Jobs/JobWireTests.cs
T
Alby96andClaude Opus 5.5 d472dfdec1 feat: phase 5 groundwork (playback format 3, videos contracts, migration 0010, strings)
Lays down every contract the later parcels of owner review 1 phase 5 build on,
so they compile against shared types without touching each other's files.

- Settings format 3: export.playback (direction, loops, fades, hold), omitted
  at its default and member by member; RequiredFormat is 3 only while used.
- OutputProgram public API with a forward-only body; still-frame job
  parameters (StillFrame, StillPhoto) routed to format-3 nodes only.
- Render.Sha256/Kind, RenderCopy, RenderKind; JobKind.VideoCopy = 24.
- Migration 0010 (sqlite, postgres): renders.sha256/kind, ix_renders_created,
  render_copies without a foreign key.
- Videos protocol DTOs, client calls, ServerCapabilities.Videos (declared,
  not announced yet), ServerSettingsDto.VideosPath.
- IVideoLibrary with a NotImplemented stub registered on the server;
  TrashKind.Videos, VideoTrashNames, VideoErrors.
- en and it strings for the whole phase, five icons, decisions 1-22 and the
  open-question defaults; tests that used format 3 as "newer" now use 4.

Refs #21

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 01:48:33 +01:00

33 lines
1.1 KiB
C#

using Chronos.Core.Model;
using Chronos.Data.Jobs;
using Chronos.Testing;
namespace Chronos.Data.Tests.Jobs;
/// <summary>The names the jobs' kinds carry on the wire and in settings (BRIEF §14.6): stable once shipped.</summary>
[Category("jobs")]
public sealed class JobWireTests
{
[Theory]
[Case(JobKind.WorkspaceCopy, 20, "workspace-copy")]
[Case(JobKind.WorkspaceRender, 21, "workspace-render")]
[Case(JobKind.WorkspaceSend, 22, "workspace-send")]
[Case(JobKind.WorkspaceMove, 23, "workspace-move")]
[Case(JobKind.VideoCopy, 24, "video-copy")]
public void TheWorkspaceJobsKeepTheirValueAndName(JobKind kind, int value, string name)
{
Assert.Equal(value, (int)kind);
Assert.Equal(name, JobWire.Kind(kind));
Assert.True(JobWire.TryParseKind(name, out var parsed), name);
Assert.Equal(kind, parsed);
}
[Test]
public void EveryKindHasItsOwnName()
{
var names = Enum.GetValues<JobKind>().Select(JobWire.Kind).ToList();
Assert.Equal(names.Count, names.Distinct(StringComparer.Ordinal).Count());
Assert.False(JobWire.TryParseKind("workspace-teleport", out _));
}
}