1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use cardlife;
/*
#[cfg(feature = "cardlife")]
#[tokio::test]
async fn clre_server_game() -> Result<(), ()> {
let server = cardlife::CLreServer::new("http://localhost:5030").unwrap();
let result = server.game_info().await;
assert!(result.is_ok());
let game_info = result.unwrap();
assert_eq!(game_info.admin_password, "");
assert_eq!(game_info.game_host_type, 1);
println!("GameInfo.to_string() -> `{}`", game_info.to_string());
Ok(())
}
#[cfg(feature = "cardlife")]
#[tokio::test]
async fn clre_server_status() -> Result<(), ()> {
let server = cardlife::CLreServer::new("http://localhost:5030").unwrap();
let result = server.status_info().await;
assert!(result.is_ok());
let status_info = result.unwrap();
assert_eq!(status_info.status, "Online");
assert_eq!(status_info.max_players, 10);
assert_eq!(status_info.player_count, status_info.online_players.len());
if status_info.online_players.len() != 0 {
for player in &status_info.online_players {
assert_ne!(player.name, "");
assert_ne!(player.id, "");
assert!(!player.is_dev);
println!("PlayerStatusInfo.to_string() -> `{}`", player.to_string());
}
}
Ok(())
}*/