updates to mock content and contract view implementation
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user