|
|
|
@ -274,4 +274,23 @@ mod tests { |
|
|
|
assert_eq!(context.rooms, rooms);
|
|
|
|
assert_eq!(context.users, users);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn server_logged_in_context_logout() {
|
|
|
|
let (tx, _rx) = channel(100);
|
|
|
|
|
|
|
|
let context = ServerLoggedInContext::new(
|
|
|
|
tx,
|
|
|
|
ServerLoggedInContextOptions {
|
|
|
|
users: UserMap::new(),
|
|
|
|
rooms: RoomMap::new(),
|
|
|
|
user_name: "bob".to_string(),
|
|
|
|
motd: "hey".to_string(),
|
|
|
|
},
|
|
|
|
)
|
|
|
|
.logout();
|
|
|
|
|
|
|
|
assert_eq!(context.user_name(), "bob");
|
|
|
|
assert_eq!(context.error(), None);
|
|
|
|
}
|
|
|
|
}
|