-
Notifications
You must be signed in to change notification settings - Fork 0
/
api_test.rs
167 lines (131 loc) · 4.25 KB
/
api_test.rs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
#[cfg(test)]
mod test {
use zunivers_rs::model::app::{AppSettings, AppStatus};
use zunivers_rs::model::card::{Fusion, InventoryEntry, Item, ItemDetail, RarityMetadata};
use zunivers_rs::model::challenge::ActiveChallenge;
use zunivers_rs::model::event::Event;
use zunivers_rs::model::pack::Pack;
use zunivers_rs::model::post::Post;
use zunivers_rs::model::rayou::Jackpot;
use zunivers_rs::model::shop::ShopEntry;
use zunivers_rs::model::user::{Profile, UserBanner, UserLoot};
use zunivers_rs::model::vortex::{Tournament, VortexSeason};
#[tokio::test]
async fn test_packs() {
let packs = Pack::fetch_all().await;
assert!(packs.is_ok());
assert!(packs.unwrap().len() > 0);
}
#[tokio::test]
async fn test_items() {
let items = Item::fetch_all().await;
assert!(items.is_ok());
assert!(items.unwrap().len() > 0);
}
#[tokio::test]
async fn test_search_items() {
let items = Item::fetch_all_params(&[
("search".to_string(), "Garros".to_string())
]).await;
assert!(items.is_ok());
assert_eq!(items.unwrap().len(), 1);
}
#[tokio::test]
async fn test_item() {
let item = ItemDetail::fetch(&String::from("4030-adrien-nou-garros")).await;
assert!(item.is_ok());
}
#[tokio::test]
async fn test_fusion() {
let fusions = Fusion::fetch_all().await;
assert!(fusions.is_ok());
assert!(fusions.unwrap().len() > 0)
}
#[tokio::test]
async fn test_inventory() {
let inventory = InventoryEntry::fetch_for(&String::from("alexpresso")).await;
assert!(inventory.is_ok());
assert!(inventory.unwrap().len() > 0)
}
#[tokio::test]
async fn test_user_profile() {
let user = Profile::fetch(&String::from("alexpresso")).await;
assert!(user.is_ok());
}
#[tokio::test]
async fn test_user_loot() {
let loot = UserLoot::fetch_for(&String::from("alexpresso")).await;
assert!(loot.is_ok());
}
#[tokio::test]
async fn test_user_banner() {
let banners = UserBanner::fetch_for(&String::from("alexpresso")).await;
assert!(banners.is_ok());
assert!(banners.unwrap().len() > 0)
}
#[tokio::test]
async fn test_app_status() {
let status = AppStatus::fetch().await;
assert!(status.is_ok());
}
#[tokio::test]
async fn test_app_settings() {
let settings = AppSettings::fetch().await;
assert!(settings.is_ok());
}
#[tokio::test]
async fn test_posts() {
let posts = Post::fetch_all().await;
assert!(posts.is_ok());
assert!(posts.unwrap().len() > 0);
}
#[tokio::test]
async fn test_post() {
let post = Post::fetch(&String::from("patch-notes-2-1")).await;
assert!(post.is_ok());
assert!(post.unwrap().content.unwrap().len() > 0);
}
#[tokio::test]
async fn test_jackpot() {
let jackpot = Jackpot::fetch().await;
assert!(jackpot.is_ok());
}
#[tokio::test]
async fn test_shop() {
let shop = ShopEntry::fetch_all().await;
assert!(shop.is_ok());
assert!(shop.unwrap().len() > 0);
}
#[tokio::test]
async fn test_current_events() {
let events = Event::fetch_current().await;
assert!(events.is_ok());
}
#[tokio::test]
async fn test_active_challenges() {
let challenges = ActiveChallenge::fetch_all().await;
assert!(challenges.is_ok());
assert!(challenges.unwrap().len() > 0);
}
#[tokio::test]
async fn test_user_challenges() {
let challenges = ActiveChallenge::fetch_for("alexpresso".to_string()).await;
assert!(challenges.is_ok());
assert!(challenges.unwrap().len() > 0 );
}
#[tokio::test]
async fn test_vortex_season() {
let vortex = VortexSeason::fetch().await;
assert!(vortex.is_ok());
}
#[tokio::test]
async fn test_vortex_tournament() {
let tournament = Tournament::fetch().await;
assert!(tournament.is_ok());
}
#[tokio::test]
async fn test_recycle_config() {
let config = RarityMetadata::fetch_all().await;
assert!(config.is_ok());
}
}