Fase 3a: bibliotheektabellen krijgen set, varianten en uitsnede-overrides (additief), kopie, schrijf-door en controle vullen en vergelijken ze
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -112,4 +112,19 @@ public class MediaLibraryCopierTests : IDisposable
|
||||
report.Assets.Should().Be(2);
|
||||
report.Uses.Should().Be(1);
|
||||
}
|
||||
[Fact]
|
||||
public async Task Copies_and_verifies_the_variants_the_set_hash_and_the_crop_overrides_of_a_photo_and_of_a_use()
|
||||
{
|
||||
var variants = "[{\"Ratio\":\"wide\",\"Width\":480,\"Height\":270,\"Type\":\"image/webp\",\"FileName\":\"wide-480.webp\",\"Bytes\":1234}]";
|
||||
var a = Asset() with { VariantsJson = variants, WideFocusX = 0.1, WideFocusY = 0.2, WideZoom = 1.3, TallFocusX = 0.7 };
|
||||
var use = Use(a) with { VariantsJson = variants, SetHash = "fedcba9876543210" };
|
||||
|
||||
await Copier(new Source("hero", [a], [use])).CopyAsync(CancellationToken.None);
|
||||
|
||||
var photo = await _db.MediaAssets.SingleAsync();
|
||||
photo.Variants.Should().Be(variants);
|
||||
photo.SetHash.Should().Be(a.SetHash);
|
||||
(photo.WideFocusX, photo.WideFocusY, photo.WideZoom, photo.TallFocusX, photo.TallFocusY).Should().Be((0.1, 0.2, 1.3, 0.7, null));
|
||||
(await _db.MediaUses.SingleAsync()).Variants.Should().Be(variants);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user