merge: review2-p5a-fix-workspace into phase 5a fix round 1 integration
# Conflicts: # src/Chronos.Data/Workspaces/WorkspaceSync.cs
This commit is contained in:
commit
9772c2f934
18 files changed
+958
-93
No files matched your search
@@ -1,3 +1,4 @@
|
||||
using Chronos.Core.Localization;
|
||||
using Chronos.Core.Project;
|
||||
using Chronos.Testing;
|
||||
|
||||
@@ -107,6 +108,23 @@ public sealed class ProjectBundleTests(TestContext context)
|
||||
Assert.Throws<InvalidDataException>(() => ProjectBundle.Load(path));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void AFileNoReadCouldTakeBackIsRefusedBeforeItIsWritten()
|
||||
{
|
||||
var folder = context.CreateTempDirectory("bundle");
|
||||
var path = Path.Combine(folder, "huge.chronos");
|
||||
var sample = Sample();
|
||||
var huge = sample with { Sequence = sample.Sequence with { Title = new string('x', ProjectBundle.MaxBytes) } };
|
||||
var refused = Assert.Throws<ProjectTooLargeException>(() => huge.Save(path));
|
||||
Assert.Equal(Loc.L("Errors.Project.TooLarge", ProjectBundle.MaxBytes >> 20), refused.Message);
|
||||
Assert.False(File.Exists(path));
|
||||
Assert.Empty(Directory.GetFiles(folder));
|
||||
|
||||
// Within the limit, the file is written and read back.
|
||||
sample.Save(path);
|
||||
Assert.Equal(sample.Sequence.Title, ProjectBundle.Load(path).Sequence.Title);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void FramePositionsApplyOnlyToTheFramesTheyWereSavedFor()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user