The desktop now uses the per-home layout from P3.1: each home keeps its own projects, proxies and originals, and a server is known by its id whichever address reaches it. - Settings keep the known servers (id, name, last address, certificate, aliases, originals archive). Reset and Import keep them; Export leaves them out. - SyncHost records each server the first time it signs in with an id. It names the cache and workspace folders by that id, and re-keys the folders a server had under its addresses at sign-in. The re-key waits while transfer or workspace jobs are pending. - Download originals goes to the server's own archive. It is created beside this PC's archive at the first download, and a toast says where. A sequence that already has a local copy keeps receiving into that copy's archive. A server without an id keeps the 1.0 behaviour. - At start, after the index opens and before any job runs, the folders are sorted into their homes. A toast reports the result: sorted, pending or failed. - The workspace host gives each home's store its own sync. Find, List, usage, clean-up and the trash plan and empty cover every home. Server comparisons go through the identity, so a project stays Online when its server is reached by another address. - The render-node downloads and the server import staging move into the server's folder of the cache. The cache trim keeps `servers`, and the scheduled scan also scans the originals archives. - Settings shows the Home folders rows (Workspace) and the Known servers table (Server). The diagnostics bundle lists the homes. - The dead `AppPaths.CreateDirectories` and `ThumbnailsDirectory` are removed. Refs #66 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
378 lines
21 KiB
C#
378 lines
21 KiB
C#
using System.IO;
|
|
using Chronos.App.Editor;
|
|
using Chronos.App.Infrastructure;
|
|
using Chronos.App.Workspace;
|
|
using Chronos.Core.Localization;
|
|
using Chronos.Core.Model;
|
|
using Chronos.Core.Project;
|
|
using Chronos.Data.Projects;
|
|
using Chronos.Data.Sync;
|
|
using Chronos.Ui.Controls;
|
|
using Chronos.Data.Workspaces;
|
|
using Chronos.Testing;
|
|
|
|
namespace Chronos.App.Tests.Workspace;
|
|
|
|
/// <summary>
|
|
/// The editor and the project menu of a workspace project as review 2's phase 5a found them wanting (owner review 2, R8):
|
|
/// saves that merge positions photo by photo and ask where both changed a setting, Take the library's as one undo step,
|
|
/// the chip read again after edits, conflicts that wait for the open dialog, Send first that shows the conflict it met,
|
|
/// Open project, read-only after a pull, a workspace inside a library, and how differences and authors read.
|
|
/// </summary>
|
|
[Category("workspace")]
|
|
public sealed class WorkspaceMenuTests(TestContext context)
|
|
{
|
|
private static ProjectSettings Exposure(ProjectSettings p, double ev) => p with { Exposure = p.Exposure with { ExposureOffsetEv = ev } };
|
|
|
|
[Test]
|
|
public async Task SavesMergeExclusionsPhotoByPhotoAndAskWhereBothChangedASetting()
|
|
{
|
|
await using var bed = await WorkspaceTestBed.CreateAsync(context);
|
|
var host = bed.Host();
|
|
var projectId = await bed.CheckoutAsync(host);
|
|
var (_, session) = await bed.OpenAsync(host, projectId);
|
|
var conflicts = new List<ProjectConflictException>();
|
|
session.ConflictFound += conflicts.Add;
|
|
await using (session)
|
|
{
|
|
var folder = host.Find(projectId)!;
|
|
// A sync wrote another PC's exclusion of frame 5 while the editor's exclusion of frame 2 waited for its save.
|
|
var stored = folder.ReadBundle();
|
|
folder.WriteBundle(stored with { Project = stored.Project with { ExcludedFrames = [5] } });
|
|
Assert.True(session.SetExcluded([2], excluded: true));
|
|
Assert.True(await session.FlushAsync());
|
|
Assert.SequenceEqual([2, 5], folder.ReadBundle().Project.ExcludedFrames, "both exclusions are kept");
|
|
Assert.SequenceEqual([2, 5], session.Project.ExcludedFrames, "the editor shows the other one too");
|
|
Assert.Empty(conflicts);
|
|
|
|
// The same setting to another value meanwhile: asked, never decided for the editor.
|
|
stored = folder.ReadBundle();
|
|
folder.WriteBundle(stored with { Project = Exposure(stored.Project, 0.5) });
|
|
Assert.True(session.Edit(p => Exposure(p, 0.9)));
|
|
Assert.False(await session.FlushAsync(), "nothing is stored until the user chooses");
|
|
Assert.Count(1, conflicts);
|
|
var conflict = conflicts[0];
|
|
Assert.Contains(conflict.Differences, d => d.Path == "exposure.exposureOffsetEv");
|
|
Assert.Equal(0.5, folder.ReadBundle().Project.Exposure.ExposureOffsetEv);
|
|
var request = EditorViewModel.LibraryConflictRequest(conflict, "Harbour");
|
|
Assert.Equal(Loc.L("Editor.Workspace.Conflict.TakeHome"), request.SafeText);
|
|
Assert.Contains("0.9", request.Detail!);
|
|
Assert.True(session.ResolveConflict(keepMine: true));
|
|
Assert.True(await session.FlushAsync());
|
|
Assert.Equal(0.9, folder.ReadBundle().Project.Exposure.ExposureOffsetEv);
|
|
Assert.SequenceEqual([2, 5], folder.ReadBundle().Project.ExcludedFrames);
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public async Task TakingTheLibrarysValuesIsOneUndoStepThatKeepsItsOtherChanges()
|
|
{
|
|
await using var bed = await WorkspaceTestBed.CreateAsync(context);
|
|
var here = bed.Host();
|
|
var there = bed.Host(name: "other-pc");
|
|
var mainId = await bed.CheckoutAsync(here);
|
|
await bed.CheckoutAsync(there);
|
|
var (sourceA, sessionA) = await bed.OpenAsync(there, mainId);
|
|
var (sourceB, sessionB) = await bed.OpenAsync(here, mainId);
|
|
var (uiA, uiB) = (new RecordingUi(), new RecordingUi());
|
|
await using (sessionA)
|
|
await using (sessionB)
|
|
using (var a = new ProjectMenuViewModel(there, sourceA, sessionA, uiA))
|
|
using (var b = new ProjectMenuViewModel(here, sourceB, sessionB, uiB))
|
|
{
|
|
// The other PC changes the exposure and the camera; this one the exposure only.
|
|
sessionA.Edit(p => Exposure(p, 0.1) with { Camera = p.Camera with { OffsetY = 0.2 } });
|
|
await a.SaveVersionAsync(null);
|
|
sessionB.Edit(p => Exposure(p, 0.7));
|
|
await b.SyncAsync();
|
|
var dialog = Assert.NotNull(uiB.Open as ConflictDialogViewModel);
|
|
Assert.Count(1, dialog.Differences);
|
|
|
|
dialog.TakeHomeCommand.Execute(null);
|
|
await WorkspaceTestBed.UntilAsync(() => uiB.Open is null, "take the library's settles it");
|
|
Assert.Equal((0.1, 0.2), (sessionB.Project.Exposure.ExposureOffsetEv, sessionB.Project.Camera.OffsetY));
|
|
var toast = uiB.Toasts[^1];
|
|
Assert.Equal(Loc.L("Editor.Workspace.TookLibrary"), toast.Title);
|
|
|
|
// Its Undo brings this PC's exposure back, not the camera the library alone changed; Ctrl+Z takes the take back alike.
|
|
toast.Action!();
|
|
Assert.Equal((0.7, 0.2), (sessionB.Project.Exposure.ExposureOffsetEv, sessionB.Project.Camera.OffsetY));
|
|
Assert.True(sessionB.Undo());
|
|
Assert.Equal(0.1, sessionB.Project.Exposure.ExposureOffsetEv);
|
|
Assert.True(sessionB.Undo());
|
|
Assert.Equal((0.7, 0.2), (sessionB.Project.Exposure.ExposureOffsetEv, sessionB.Project.Camera.OffsetY));
|
|
Assert.True(await sessionB.FlushAsync());
|
|
var working = here.Find(mainId)!.ReadBundle().Project;
|
|
Assert.Equal((0.7, 0.2), (working.Exposure.ExposureOffsetEv, working.Camera.OffsetY), "the values brought back are stored");
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public async Task TheChipFollowsEditsAndABackgroundConflictWaitsForTheOpenDialog()
|
|
{
|
|
await using var bed = await WorkspaceTestBed.CreateAsync(context);
|
|
var here = bed.Host();
|
|
var there = bed.Host(name: "other-pc");
|
|
var mainId = await bed.CheckoutAsync(here);
|
|
await bed.CheckoutAsync(there);
|
|
var (sourceA, sessionA) = await bed.OpenAsync(there, mainId);
|
|
var (sourceB, sessionB) = await bed.OpenAsync(here, mainId);
|
|
var (uiA, uiB) = (new RecordingUi(), new RecordingUi());
|
|
await using (sessionA)
|
|
await using (sessionB)
|
|
using (var a = new ProjectMenuViewModel(there, sourceA, sessionA, uiA))
|
|
using (var b = new ProjectMenuViewModel(here, sourceB, sessionB, uiB))
|
|
{
|
|
await b.RefreshAsync();
|
|
Assert.Equal(Loc.L("Editor.Workspace.State.InSync"), b.StateText);
|
|
sessionB.Edit(p => Exposure(p, 0.7));
|
|
await WorkspaceTestBed.UntilAsync(() => b.StateText == Loc.L("Editor.Workspace.State.Modified"), "the chip says the work is not saved as a version");
|
|
|
|
sessionA.Edit(p => Exposure(p, 0.1));
|
|
await a.SaveVersionAsync(null);
|
|
// The user types a note in Save version when an automatic sync (after an analysis) meets the conflict.
|
|
b.SaveVersionCommand.Execute(null);
|
|
var saving = Assert.NotNull(uiB.Open as SaveVersionDialogViewModel);
|
|
saving.Note = "Warmer";
|
|
await b.SyncAsync(quiet: true);
|
|
Assert.Same(saving, uiB.Open, "the open dialog stays");
|
|
Assert.Equal("Warmer", saving.Note);
|
|
Assert.Equal(WorkspaceState.Conflict, b.Status!.State);
|
|
await b.SyncAsync(quiet: true);
|
|
Assert.Count(1, uiB.Waiting, "asked once");
|
|
uiB.CloseDialog(saving);
|
|
Assert.NotNull(uiB.Open as ConflictDialogViewModel, "asked once the dialog closed");
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public async Task SendFirstShowsTheConflictItMeetsAndRemovesNothing()
|
|
{
|
|
await using var bed = await WorkspaceTestBed.CreateAsync(context);
|
|
var here = bed.Host();
|
|
var there = bed.Host(name: "other-pc");
|
|
var mainId = await bed.CheckoutAsync(here);
|
|
await bed.CheckoutAsync(there);
|
|
var (sourceA, sessionA) = await bed.OpenAsync(there, mainId);
|
|
var (sourceB, sessionB) = await bed.OpenAsync(here, mainId);
|
|
var (uiA, uiB) = (new RecordingUi(), new RecordingUi());
|
|
await using (sessionA)
|
|
await using (sessionB)
|
|
using (var a = new ProjectMenuViewModel(there, sourceA, sessionA, uiA))
|
|
using (var b = new ProjectMenuViewModel(here, sourceB, sessionB, uiB))
|
|
{
|
|
sessionA.Edit(p => Exposure(p, 0.1));
|
|
await a.SaveVersionAsync(null);
|
|
sessionB.Edit(p => Exposure(p, 0.7));
|
|
Assert.True(await sessionB.FlushAsync());
|
|
|
|
b.RemoveCopyCommand.Execute(null);
|
|
await WorkspaceTestBed.UntilAsync(() => uiB.Open is RemoveCopyDialogViewModel, "the plan shows");
|
|
var removing = (RemoveCopyDialogViewModel)uiB.Open!;
|
|
removing.SendFirstCommand.Execute(null);
|
|
await WorkspaceTestBed.UntilAsync(() => uiB.Open is ConflictDialogViewModel, "the conflict is asked, not hidden behind Discard");
|
|
Assert.Equal(0, uiB.Closed, "the editor stays open");
|
|
Assert.NotNull(here.Find(mainId), "nothing was removed");
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public async Task SaveBothOfAProjectDeletedInTheLibrarySaysItIsGoneOnceAndOffersTheCopy()
|
|
{
|
|
await using var bed = await WorkspaceTestBed.CreateAsync(context);
|
|
var here = bed.Host();
|
|
var there = bed.Host(name: "other-pc");
|
|
var sideId = await bed.CheckoutAsync(here, newName: "Side");
|
|
await bed.CheckoutAsync(there, sideId);
|
|
var (sourceA, sessionA) = await bed.OpenAsync(there, sideId);
|
|
var (sourceB, sessionB) = await bed.OpenAsync(here, sideId);
|
|
var (uiA, uiB) = (new RecordingUi(), new RecordingUi());
|
|
await using (sessionA)
|
|
await using (sessionB)
|
|
using (var a = new ProjectMenuViewModel(there, sourceA, sessionA, uiA))
|
|
using (var b = new ProjectMenuViewModel(here, sourceB, sessionB, uiB))
|
|
{
|
|
sessionA.Edit(p => Exposure(p, 0.1));
|
|
await a.SaveVersionAsync(null);
|
|
sessionB.Edit(p => Exposure(p, 0.7));
|
|
await b.SyncAsync();
|
|
uiB.CloseDialog(Assert.NotNull(uiB.Open as ConflictDialogViewModel));
|
|
// Another PC deletes the project in the library while the choice is made here.
|
|
await bed.Archives.Projects.DeleteAsync(sideId, bed.Ct);
|
|
var before = uiB.Toasts.Count;
|
|
|
|
await b.ResolveAsync(ConflictChoice.SaveBoth);
|
|
Assert.Equal(WorkspaceState.Gone, b.Status!.State);
|
|
Assert.Null(b.Status.Conflict, "nothing is left to answer");
|
|
Assert.Null(uiB.Open, "the conflict is not asked again");
|
|
var said = uiB.Toasts.Skip(before).ToList();
|
|
Assert.Count(1, said.Where(t => t.Message == Loc.L("Errors.Workspace.DeletedAtHome")).ToList());
|
|
var copy = Assert.Contains(said, t => t.Action is not null);
|
|
Assert.Equal(b.Name, copy.Message, "the copy Save both made is offered");
|
|
Assert.False(b.SaveVersionCommand.CanExecute(null), "nothing can be sent to it");
|
|
Assert.Equal(0.7, sessionB.Project.Exposure.ExposureOffsetEv, "the work stays in the editor");
|
|
Assert.Equal(0.7, here.Find(sideId)!.ReadBundle().Project.Exposure.ExposureOffsetEv);
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public async Task OpenProjectOffersTheLibrarysOtherProjects()
|
|
{
|
|
await using var bed = await WorkspaceTestBed.CreateAsync(context);
|
|
var host = bed.Host();
|
|
var mainId = await bed.CheckoutAsync(host);
|
|
var vertical = await host.CreateProjectAsync(bed.SequenceId, "Vertical", null);
|
|
var (source, session) = await bed.OpenAsync(host, mainId);
|
|
var ui = new RecordingUi();
|
|
await using (session)
|
|
using (var menu = new ProjectMenuViewModel(host, source, session, ui))
|
|
{
|
|
menu.OpenProjectCommand.Execute(null);
|
|
await WorkspaceTestBed.UntilAsync(() => ui.Open is OpenInWorkspaceDialogViewModel, "the projects are listed");
|
|
var dialog = (OpenInWorkspaceDialogViewModel)ui.Open!;
|
|
Assert.SequenceEqual(["Vertical"], dialog.Projects.Select(p => p.Project.Name), "the open project is not offered");
|
|
dialog.IsNew = true;
|
|
dialog.NewName.Text = "Main";
|
|
Assert.False(dialog.CanOpen, "the open project's name is taken");
|
|
dialog.IsExisting = true;
|
|
dialog.SelectedProject = dialog.Projects[0];
|
|
dialog.OpenCommand.Execute(null);
|
|
await WorkspaceTestBed.UntilAsync(() => ui.Opened.Count == 1, "the project opens");
|
|
Assert.Equal((bed.SequenceId, vertical.Id), ui.Opened[0]);
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public async Task APullOfANewerChronossSettingsTurnsTheEditorReadOnly()
|
|
{
|
|
await using var bed = await WorkspaceTestBed.CreateAsync(context);
|
|
var host = bed.Host();
|
|
var projectId = await bed.CheckoutAsync(host);
|
|
var (source, session) = await bed.OpenAsync(host, projectId);
|
|
var raised = 0;
|
|
source.ReadOnlyChanged += () => raised++;
|
|
await using (session)
|
|
{
|
|
Assert.False(session.IsReadOnly);
|
|
var folder = host.Find(projectId)!;
|
|
var stored = folder.ReadBundle();
|
|
folder.WriteBundle(stored with { Project = stored.Project with { Version = ProjectSettings.CurrentVersion + 1 } });
|
|
await session.ReloadAsync();
|
|
Assert.True(session.IsReadOnly);
|
|
Assert.Equal(1, raised, "the editor is told, and shows it");
|
|
Assert.False(session.HasPendingSave, "no save that could never be stored waits");
|
|
Assert.False(session.Edit(p => Exposure(p, 0.4)));
|
|
Assert.True(await session.FlushAsync(), "operations that store the last edit go on");
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public async Task AWorkspaceInsideALibraryIsRefusedBeforeAnythingIsWritten()
|
|
{
|
|
await using var bed = await WorkspaceTestBed.CreateAsync(context);
|
|
var row = await bed.RowAsync();
|
|
var root = (await bed.Db.Archives.GetAsync(row.ArchiveId))!.RootPath;
|
|
var inside = Path.Combine(root, "Chronos", "data", "workspace");
|
|
var host = bed.Host(new AppSettings { WorkspaceFolder = inside });
|
|
Assert.Empty(await host.ListAsync());
|
|
Assert.Null(await host.FindAsync(Guid.NewGuid()));
|
|
var refused = await Assert.ThrowsAsync<WorkspaceException>(() => host.CheckoutAsync(bed.SequenceId, null, null));
|
|
Assert.Equal(Loc.L("Errors.Workspace.InsideLibraryEdit", inside), refused.Message);
|
|
Assert.False(Directory.Exists(inside), "nothing was written there");
|
|
}
|
|
|
|
[Test]
|
|
public void ACopyTheLibraryNoLongerHasCanOnlyBeDiscarded()
|
|
{
|
|
var plan = new WorkspaceRemovalPlan(Guid.NewGuid(), "Vertical", 3, 100, 0, false, false, true, Gone: true);
|
|
var dialog = new RemoveCopyDialogViewModel(plan, _ => Task.CompletedTask, () => Task.CompletedTask, () => false, _ => { });
|
|
Assert.False(dialog.RemoveCommand.CanExecute(null) || dialog.SendFirstCommand.CanExecute(null));
|
|
Assert.True(dialog.HasUnsent && dialog.DiscardCommand.CanExecute(null));
|
|
Assert.Equal(Loc.L("Errors.Workspace.ProjectGone"), dialog.RemoveToolTip);
|
|
|
|
// The chip keeps what the library said last when the working state is read again after an edit.
|
|
var basis = new BundleBase(Guid.NewGuid(), 2, new string('a', 64));
|
|
var gone = new WorkspaceStatus(WorkspaceState.Gone, false, 0, 0, true, false, false, null, basis, null);
|
|
var edited = new WorkspaceStatus(WorkspaceState.Modified, true, 0, 0, false, false, false, null, basis, null);
|
|
Assert.Equal(WorkspaceState.Gone, ProjectMenuViewModel.WithLocal(gone, edited).State);
|
|
// A conflict recorded here asks nothing of a project the library no longer has.
|
|
var recorded = new WorkspaceConflict(Guid.NewGuid(), 3, basis.VersionId, [], [], DateTimeOffset.UtcNow);
|
|
var stillGone = ProjectMenuViewModel.WithLocal(gone, edited with { State = WorkspaceState.Conflict, Conflict = recorded });
|
|
Assert.Equal((WorkspaceState.Gone, (WorkspaceConflict?)null), (stillGone.State, stillGone.Conflict));
|
|
var behind = gone with { State = WorkspaceState.Behind, Behind = 2, Offline = false };
|
|
Assert.Equal((WorkspaceState.Behind, 2), (ProjectMenuViewModel.WithLocal(behind, edited).State, ProjectMenuViewModel.WithLocal(behind, edited).Behind));
|
|
Assert.Equal(WorkspaceState.Modified, ProjectMenuViewModel.WithLocal(behind, edited with { Base = basis with { VersionId = Guid.NewGuid() } }).State,
|
|
"a base that moved since says nothing of how far the library is ahead");
|
|
// A version saved here that cannot be read outranks what the library said.
|
|
Assert.Equal(WorkspaceState.Damaged, ProjectMenuViewModel.WithLocal(behind, edited with { Damaged = 1 }).State);
|
|
}
|
|
|
|
[Test]
|
|
public void ADamagedVersionAndOneTooLargeReadAsSuch()
|
|
{
|
|
var damaged = new WorkspaceStatus(WorkspaceState.Damaged, false, 1, 0, false, false, false, null, null, null) { Damaged = 1 };
|
|
Assert.Equal((Loc.L("Editor.Workspace.State.Damaged"), StatusKind.Error), (WorkspaceText.State(damaged), WorkspaceText.Kind(damaged)));
|
|
Assert.Equal(Loc.L("Tooltips.Editor.Workspace.State.Damaged"), WorkspaceText.StateToolTip(damaged));
|
|
Assert.Equal(Loc.L("Errors.Workspace.Damaged"), WorkspaceText.Failure(new InvalidDataException("a version file cannot be read")));
|
|
|
|
// Too large: a version saved here (refused before it was written) and one the library refused say the same, with the limit.
|
|
var tooLarge = Loc.L("Errors.Workspace.VersionTooLarge", ProjectSidecars.MaxVersionBytes >> 20);
|
|
Assert.Contains("64", tooLarge);
|
|
Assert.Equal(tooLarge, WorkspaceText.Failure(new ProjectVersionTooLargeException("over the limit")));
|
|
Assert.Equal(tooLarge, WorkspaceText.Failure(new WorkspaceSyncException(PushOutcome.TooLarge, "over the limit")));
|
|
Assert.Equal(tooLarge, Chronos.App.Shell.ErrorText.For(new ProjectVersionTooLargeException("over the limit")));
|
|
Assert.Equal(Loc.L("Errors.Workspace.Refused"), WorkspaceText.Failure(new WorkspaceSyncException(PushOutcome.Invalid, "not this project's")));
|
|
}
|
|
|
|
[Test]
|
|
public void DifferencesNameTheirSettingsAndAuthorsReadAsThePc()
|
|
{
|
|
var lines = WorkspaceText.ConflictLines(
|
|
[
|
|
new SettingsDifference("hero", "{\"hero\":true}", "{\"hero\":true}"),
|
|
new SettingsDifference("pendingFrames.sha:ab12#0.keyframes", "[]", "[{\"x\":1}]"),
|
|
new SettingsDifference("pendingFrames.sha:cd34#0.excluded", "true", "false"),
|
|
], 10);
|
|
Assert.Count(3, lines);
|
|
Assert.Contains(lines, l => l.Contains(Loc.L("Server.Setting.HeroFrame"), StringComparison.Ordinal));
|
|
Assert.Contains(lines, l => l.Contains(Loc.L("Server.Setting.Keyframes"), StringComparison.Ordinal));
|
|
Assert.Contains(lines, l => l.Contains(Loc.L("Server.Setting.ExcludedFrames"), StringComparison.Ordinal));
|
|
Assert.False(lines.Any(l => l.Contains(Loc.L("Server.Setting.Other"), StringComparison.Ordinal)), "every line names its setting");
|
|
|
|
ProjectVersion Made(string? client, string? author = null) => new()
|
|
{
|
|
Id = Guid.NewGuid(),
|
|
ProjectId = Guid.NewGuid(),
|
|
Number = 1,
|
|
SettingsJson = "{}",
|
|
ContentHash = new string('0', 64),
|
|
ClientName = client,
|
|
Author = author,
|
|
};
|
|
Assert.Equal("STUDIO-PC", WorkspaceText.Author(Made("chronos@STUDIO-PC")));
|
|
Assert.Equal("STUDIO-PC", WorkspaceText.Author(Made("Chronos on STUDIO-PC")));
|
|
Assert.Equal("STUDIO-PC", WorkspaceText.Author(Made("STUDIO-PC")));
|
|
Assert.Equal("Alberto", WorkspaceText.Author(Made("STUDIO-PC", "Alberto")));
|
|
Assert.Equal(Environment.MachineName, WorkspaceHost.ClientName);
|
|
}
|
|
|
|
[Test]
|
|
public async Task CompareNamesExclusionsAsTheSettingTheyAre()
|
|
{
|
|
await using var bed = await WorkspaceTestBed.CreateAsync(context);
|
|
var host = bed.Host();
|
|
var projectId = await bed.CheckoutAsync(host);
|
|
var (source, session) = await bed.OpenAsync(host, projectId);
|
|
var ui = new RecordingUi();
|
|
await using (session)
|
|
using (var menu = new ProjectMenuViewModel(host, source, session, ui))
|
|
{
|
|
var head = (await host.HistoryAsync(projectId)).Versions[0];
|
|
Assert.True(session.SetExcluded([1, 3], excluded: true));
|
|
var lines = menu.Compare(head);
|
|
Assert.Count(1, lines);
|
|
Assert.Contains(Loc.L("Server.Setting.ExcludedFrames"), lines[0]);
|
|
}
|
|
}
|
|
}
|