updates to mock content and contract view implementation

This commit is contained in:
Timur Gordon
2025-04-23 03:52:11 +02:00
parent 6060831f61
commit b56f1cbc30
9 changed files with 1453 additions and 644 deletions

View File

@@ -145,8 +145,8 @@ mod tests {
#[test]
fn test_new_user() {
let user = User::new("John Doe".to_string(), "john@example.com".to_string());
assert_eq!(user.name, "John Doe");
let user = User::new("Robert Callingham".to_string(), "john@example.com".to_string());
assert_eq!(user.name, "Robert Callingham");
assert_eq!(user.email, "john@example.com");
assert!(!user.is_admin());
}
@@ -161,13 +161,13 @@ mod tests {
#[test]
fn test_update_user() {
let mut user = User::new("John Doe".to_string(), "john@example.com".to_string());
user.update(Some("Jane Doe".to_string()), None);
assert_eq!(user.name, "Jane Doe");
let mut user = User::new("Robert Callingham".to_string(), "john@example.com".to_string());
user.update(Some("Mary Hewell".to_string()), None);
assert_eq!(user.name, "Mary Hewell");
assert_eq!(user.email, "john@example.com");
user.update(None, Some("jane@example.com".to_string()));
assert_eq!(user.name, "Jane Doe");
assert_eq!(user.name, "Mary Hewell");
assert_eq!(user.email, "jane@example.com");
}
}