domain: add Media Catalog entities (Asset, Metadata, Stack, Derivative, Duplicate)
This commit is contained in:
24
crates/domain/tests/entities/asset.rs
Normal file
24
crates/domain/tests/entities/asset.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
use domain::entities::{Asset, AssetType, SourceReference};
|
||||
use domain::value_objects::{Checksum, SystemId};
|
||||
|
||||
fn make_asset() -> Asset {
|
||||
let src = SourceReference {
|
||||
volume_id: SystemId::new(),
|
||||
relative_path: "photos/img.jpg".to_string(),
|
||||
checksum: Checksum::new("a".repeat(64)).unwrap(),
|
||||
};
|
||||
Asset::new(src, AssetType::Image, "image/jpeg", 1024, SystemId::new())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn new_asset_is_unprocessed() {
|
||||
let a = make_asset();
|
||||
assert!(!a.is_processed);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mark_processed() {
|
||||
let mut a = make_asset();
|
||||
a.mark_processed();
|
||||
assert!(a.is_processed);
|
||||
}
|
||||
Reference in New Issue
Block a user