refactor: extract inline tests to separate files in auth + storage adapters
This commit is contained in:
10
crates/adapters/auth/tests/password.rs
Normal file
10
crates/adapters/auth/tests/password.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
use adapters_auth::BcryptPasswordHasher;
|
||||
use domain::ports::PasswordHasher;
|
||||
|
||||
#[tokio::test]
|
||||
async fn hash_and_verify_roundtrip() {
|
||||
let h = BcryptPasswordHasher;
|
||||
let hash = h.hash("mysecretpassword").await.unwrap();
|
||||
assert!(h.verify("mysecretpassword", &hash).await.unwrap());
|
||||
assert!(!h.verify("wrongpassword", &hash).await.unwrap());
|
||||
}
|
||||
Reference in New Issue
Block a user