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); }