style: cargo fmt --all

This commit is contained in:
2026-05-31 05:31:42 +02:00
parent 4b31a0f74b
commit c2ebca0da0
138 changed files with 2422 additions and 1164 deletions

View File

@@ -1,17 +1,20 @@
use std::sync::Arc;
use application::testing::InMemoryStorageVolumeRepository;
use application::storage::{RegisterVolumeCommand, RegisterVolumeHandler};
use application::testing::InMemoryStorageVolumeRepository;
use domain::errors::DomainError;
use std::sync::Arc;
#[tokio::test]
async fn creates_volume() {
let repo = Arc::new(InMemoryStorageVolumeRepository::new());
let handler = RegisterVolumeHandler::new(repo);
let vol = handler.execute(RegisterVolumeCommand {
volume_name: "primary".into(),
uri_prefix: "file:///data".into(),
is_writable: true,
}).await.unwrap();
let vol = handler
.execute(RegisterVolumeCommand {
volume_name: "primary".into(),
uri_prefix: "file:///data".into(),
is_writable: true,
})
.await
.unwrap();
assert_eq!(vol.volume_name, "primary");
assert_eq!(vol.uri_prefix, "file:///data");
assert!(vol.is_writable);
@@ -21,10 +24,12 @@ async fn creates_volume() {
async fn rejects_empty_name() {
let repo = Arc::new(InMemoryStorageVolumeRepository::new());
let handler = RegisterVolumeHandler::new(repo);
let result = handler.execute(RegisterVolumeCommand {
volume_name: "".into(),
uri_prefix: "file:///data".into(),
is_writable: true,
}).await;
let result = handler
.execute(RegisterVolumeCommand {
volume_name: "".into(),
uri_prefix: "file:///data".into(),
is_writable: true,
})
.await;
assert!(matches!(result, Err(DomainError::Validation(_))));
}