From d907bf99a227cc405ac982cf6f3276737f3c4a1e Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 29 May 2026 22:42:49 -0400 Subject: [PATCH] Added test --- src/user/mod.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/user/mod.rs b/src/user/mod.rs index 5a25302..fa9d435 100644 --- a/src/user/mod.rs +++ b/src/user/mod.rs @@ -66,3 +66,24 @@ pub fn init_user_profile(usr: &User) -> UserProfile { last_login: usr.last_login, } } + +#[cfg(test)] +mod tests { + #[test] + fn test_init_user_profile() { + let usr = super::User { + id: uuid::Uuid::new_v4(), + phone_number: String::from("+12308438462"), + username: String::from("Cowboy99"), + password: String::from("238n7cyr2q89d3xhe2"), + firstname: String::from("BillyBob"), + lastname: String::from("Jones"), + created: Some(time::OffsetDateTime::now_utc()), + last_login: Some(time::OffsetDateTime::now_utc()), + ..Default::default() + }; + + let profile = super::init_user_profile(&usr); + assert_eq!(usr.phone_number, profile.phone_number, "Phone numbers are not equal"); + } +}