style: cargo fmt --all
This commit is contained in:
@@ -6,14 +6,26 @@ use domain::value_objects::{DateTimeStamp, SystemId};
|
||||
|
||||
#[test]
|
||||
fn not_expired_when_no_expiry() {
|
||||
let scope = ShareScope::new(ScopeType::Link, ShareableType::Album, SystemId::new(), SystemId::new());
|
||||
let scope = ShareScope::new(
|
||||
ScopeType::Link,
|
||||
ShareableType::Album,
|
||||
SystemId::new(),
|
||||
SystemId::new(),
|
||||
);
|
||||
assert!(!scope.is_expired());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn expired_when_past() {
|
||||
let mut scope = ShareScope::new(ScopeType::Link, ShareableType::Album, SystemId::new(), SystemId::new());
|
||||
scope.expires_at = Some(DateTimeStamp::from_datetime(Utc::now() - Duration::hours(1)));
|
||||
let mut scope = ShareScope::new(
|
||||
ScopeType::Link,
|
||||
ShareableType::Album,
|
||||
SystemId::new(),
|
||||
SystemId::new(),
|
||||
);
|
||||
scope.expires_at = Some(DateTimeStamp::from_datetime(
|
||||
Utc::now() - Duration::hours(1),
|
||||
));
|
||||
assert!(scope.is_expired());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user