1include!(concat!(env!("OUT_DIR"), "/scopes.rs"));
2
3#[cfg(all(test, feature = "reqwest"))]
4pub(super) mod test {
5 use std::{collections::VecDeque, sync::OnceLock, time::Duration};
6
7 use tokio::sync::mpsc;
8
9 use crate::{
10 executor::{ExecutorExt, ReqwestClient},
11 models::{
12 faction_selection_name::FactionSelectionNameVariant,
13 user_selection_name::UserSelectionNameVariant, AttackCode, PersonalStatsCategoryEnum,
14 PersonalStatsStatName, UserListEnum,
15 },
16 };
17
18 use super::*;
19
20 static TICKETS: OnceLock<mpsc::Sender<mpsc::Sender<ReqwestClient>>> = OnceLock::new();
21
22 pub(crate) async fn test_client() -> ReqwestClient {
23 let (tx, mut rx) = mpsc::channel(1);
24
25 let ticket_tx = TICKETS
26 .get_or_init(|| {
27 let (tx, mut rx) = mpsc::channel(1);
28 std::thread::spawn(move || {
29 let mut queue = VecDeque::<mpsc::Sender<ReqwestClient>>::new();
30
31 let rt = tokio::runtime::Builder::new_current_thread()
32 .enable_time()
33 .build()
34 .unwrap();
35
36 rt.block_on(async move {
37 loop {
38 tokio::select! {
39 recv_result = rx.recv() => {
40 match recv_result {
41 Some(ticket) => queue.push_back(ticket),
42 None => break,
43 }
44 }
45 _ = tokio::time::sleep(Duration::from_secs(1)) => {
46 if let Some(next) = queue.pop_front() {
47 next.send(ReqwestClient::new(&std::env::var("API_KEY").unwrap())).await.unwrap()
48 }
49 }
50 }
51 }
52 });
53 });
54
55 tx
56 })
57 .clone();
58
59 ticket_tx.send(tx).await.unwrap();
60
61 rx.recv().await.unwrap()
62 }
63
64 #[tokio::test]
65 async fn faction() {
66 let client = test_client().await;
67
68 let r = client
69 .faction()
70 .for_selections(|b| {
71 b.selections([
72 FactionSelectionNameVariant::Basic,
73 FactionSelectionNameVariant::Balance,
74 ])
75 })
76 .await
77 .unwrap();
78
79 r.faction_basic_response().unwrap();
80 }
81
82 #[tokio::test]
83 async fn faction_applications() {
84 let client = test_client().await;
85
86 let faction_scope = FactionScope(&client);
87
88 faction_scope.applications(|b| b).await.unwrap();
89 }
90
91 #[tokio::test]
92 async fn faction_attacks() {
93 let client = test_client().await;
94
95 let faction_scope = FactionScope(&client);
96
97 faction_scope.attacks(|b| b).await.unwrap();
98 }
99
100 #[tokio::test]
101 async fn faction_attacksfull() {
102 let client = test_client().await;
103
104 let faction_scope = FactionScope(&client);
105
106 faction_scope.attacksfull(|b| b).await.unwrap();
107 }
108
109 #[tokio::test]
110 async fn faction_balance() {
111 let client = test_client().await;
112
113 let faction_scope = FactionScope(&client);
114
115 faction_scope.balance(|b| b).await.unwrap();
116 }
117
118 #[tokio::test]
119 async fn faction_basic() {
120 let client = test_client().await;
121
122 let faction_scope = FactionScope(&client);
123
124 faction_scope.basic(|b| b).await.unwrap();
125 }
126
127 #[tokio::test]
128 async fn faction_basic_for_id() {
129 let client = test_client().await;
130
131 let faction_scope = FactionScope(&client);
132
133 faction_scope.basic_for_id(19.into(), |b| b).await.unwrap();
134 }
135
136 #[tokio::test]
137 async fn faction_chain() {
138 let client = test_client().await;
139
140 let faction_scope = FactionScope(&client);
141
142 faction_scope.chain(|b| b).await.unwrap();
143 }
144
145 #[tokio::test]
146 async fn faction_chain_for_id() {
147 let client = test_client().await;
148
149 let faction_scope = FactionScope(&client);
150
151 faction_scope.chain_for_id(19.into(), |b| b).await.unwrap();
152 }
153
154 #[tokio::test]
155 async fn faction_chains() {
156 let client = test_client().await;
157
158 let faction_scope = FactionScope(&client);
159
160 faction_scope.chains(|b| b).await.unwrap();
161 }
162
163 #[tokio::test]
164 async fn factions_chains_for_id() {
165 let client = test_client().await;
166
167 let faction_scope = FactionScope(&client);
168
169 faction_scope.chains_for_id(19.into(), |b| b).await.unwrap();
170 }
171
172 #[tokio::test]
173 async fn faction_chain_report() {
174 let client = test_client().await;
175
176 let faction_scope = FactionScope(&client);
177
178 faction_scope.chainreport(|b| b).await.unwrap();
179 }
180
181 #[tokio::test]
182 async fn faction_chain_report_for_id() {
183 let client = test_client().await;
184
185 let faction_scope = FactionScope(&client);
186
187 faction_scope
188 .chainreport_for_chain_id(47004769.into(), |b| b)
189 .await
190 .unwrap();
191 }
192
193 #[tokio::test]
194 async fn faction_contributors() {
195 let client = test_client().await;
196
197 let faction_scope = FactionScope(&client);
198
199 faction_scope
200 .contributors(|b| b.stat(crate::models::FactionStatEnum::Revives))
201 .await
202 .unwrap();
203 }
204
205 #[tokio::test]
206 async fn faction_crimes() {
207 let client = test_client().await;
208
209 let faction_scope = FactionScope(&client);
210
211 faction_scope.crimes(|b| b).await.unwrap();
212 }
213
214 #[tokio::test]
215 async fn faction_crime_for_id() {
216 let client = test_client().await;
217
218 let faction_scope = FactionScope(&client);
219
220 faction_scope
221 .crime_for_crime_id(468347.into(), |b| b)
222 .await
223 .unwrap();
224 }
225
226 #[tokio::test]
227 async fn faction_hof() {
228 let client = test_client().await;
229
230 let faction_scope = FactionScope(&client);
231
232 faction_scope.hof(|b| b).await.unwrap();
233 }
234
235 #[tokio::test]
236 async fn faction_hof_for_id() {
237 let client = test_client().await;
238
239 let faction_scope = FactionScope(&client);
240
241 faction_scope.hof_for_id(19.into(), |b| b).await.unwrap();
242 }
243
244 #[tokio::test]
245 async fn faction_members() {
246 let client = test_client().await;
247
248 let faction_scope = FactionScope(&client);
249
250 faction_scope.members(|b| b).await.unwrap();
251 }
252
253 #[tokio::test]
254 async fn faction_members_for_id() {
255 let client = test_client().await;
256
257 let faction_scope = FactionScope(&client);
258
259 faction_scope
260 .members_for_id(19.into(), |b| b)
261 .await
262 .unwrap();
263 }
264
265 #[tokio::test]
266 async fn faction_news() {
267 let client = test_client().await;
268
269 let faction_scope = FactionScope(&client);
270
271 faction_scope
272 .news(|b| b.cat(crate::models::FactionNewsCategory::Attack))
273 .await
274 .unwrap();
275 }
276
277 #[tokio::test]
278 async fn faction_ranked_wars() {
279 let client = test_client().await;
280
281 let faction_scope = FactionScope(&client);
282
283 faction_scope.rankedwars(|b| b).await.unwrap();
284 }
285
286 #[tokio::test]
287 async fn faction_ranked_war_for_id() {
288 let client = test_client().await;
289
290 let faction_scope = FactionScope(&client);
291
292 faction_scope
293 .rankedwars_for_id(19.into(), |b| b)
294 .await
295 .unwrap();
296 }
297
298 #[tokio::test]
299 async fn faction_ranked_war_report_for_id() {
300 let client = test_client().await;
301
302 let faction_scope = FactionScope(&client);
303
304 faction_scope
305 .rankedwarreport_for_ranked_war_id(24424.into(), |b| b)
306 .await
307 .unwrap();
308 }
309
310 #[tokio::test]
311 async fn faction_revives() {
312 let client = test_client().await;
313
314 let faction_scope = FactionScope(&client);
315
316 faction_scope.revives(|b| b).await.unwrap();
317 }
318
319 #[tokio::test]
320 async fn faction_revives_full() {
321 let client = test_client().await;
322
323 let faction_scope = FactionScope(&client);
324
325 faction_scope.revives_full(|b| b).await.unwrap();
326 }
327
328 #[tokio::test]
329 async fn faction_stats() {
330 let client = test_client().await;
331
332 let faction_scope = FactionScope(&client);
333
334 faction_scope.stats(|b| b).await.unwrap();
335 }
336
337 #[tokio::test]
338 async fn faction_upgrades() {
339 let client = test_client().await;
340
341 let faction_scope = FactionScope(&client);
342
343 faction_scope.upgrades(|b| b).await.unwrap();
344 }
345
346 #[tokio::test]
347 async fn faction_wars() {
348 let client = test_client().await;
349
350 let faction_scope = FactionScope(&client);
351
352 faction_scope.wars(|b| b).await.unwrap();
353 }
354
355 #[tokio::test]
356 async fn faction_wars_for_id() {
357 let client = test_client().await;
358
359 let faction_scope = FactionScope(&client);
360
361 faction_scope.wars_for_id(19.into(), |b| b).await.unwrap();
362 }
363
364 #[tokio::test]
365 async fn faction_lookup() {
366 let client = test_client().await;
367
368 let faction_scope = FactionScope(&client);
369
370 faction_scope.lookup(|b| b).await.unwrap();
371 }
372
373 #[tokio::test]
374 async fn faction_reports() {
375 let client = test_client().await;
376
377 let faction_scope = FactionScope(&client);
378
379 faction_scope.reports(|b| b).await.unwrap();
380 }
381
382 #[tokio::test]
383 async fn forum_categories() {
384 let client = test_client().await;
385
386 let forum_scope = ForumScope(&client);
387
388 forum_scope.categories(|b| b).await.unwrap();
389 }
390
391 #[tokio::test]
392 async fn forum_posts_for_thread_id() {
393 let client = test_client().await;
394
395 let forum_scope = ForumScope(&client);
396
397 forum_scope
398 .posts_for_thread_id(16129703.into(), |b| b)
399 .await
400 .unwrap();
401 }
402
403 #[tokio::test]
404 async fn forum_thread_for_thread_id() {
405 let client = test_client().await;
406
407 let forum_scope = ForumScope(&client);
408
409 forum_scope
410 .thread_for_thread_id(16129703.into(), |b| b)
411 .await
412 .unwrap();
413 }
414
415 #[tokio::test]
416 async fn forum_threads() {
417 let client = test_client().await;
418
419 let forum_scope = ForumScope(&client);
420
421 forum_scope.threads(|b| b).await.unwrap();
422 }
423
424 #[tokio::test]
425 async fn forum_threads_for_category_ids() {
426 let client = test_client().await;
427
428 let forum_scope = ForumScope(&client);
429
430 forum_scope
431 .threads_for_category_ids([2].into(), |b| b)
432 .await
433 .unwrap();
434 }
435
436 #[tokio::test]
437 async fn forum_lookup() {
438 let client = test_client().await;
439
440 let forum_scope = ForumScope(&client);
441
442 forum_scope.lookup(|b| b).await.unwrap();
443 }
444
445 #[tokio::test]
446 async fn forum_timestamp() {
447 let client = test_client().await;
448
449 let forum_scope = ForumScope(&client);
450
451 forum_scope.timestamp(|b| b).await.unwrap();
452 }
453
454 #[tokio::test]
455 async fn market_itemmarket_for_id() {
456 let client = test_client().await;
457
458 let market_scope = MarketScope(&client);
459
460 market_scope
461 .itemmarket_for_id(1.into(), |b| b)
462 .await
463 .unwrap();
464 }
465
466 #[tokio::test]
467 async fn market_lookup() {
468 let client = test_client().await;
469
470 let market_scope = MarketScope(&client);
471
472 market_scope.lookup(|b| b).await.unwrap();
473 }
474
475 #[tokio::test]
476 async fn market_timestamp() {
477 let client = test_client().await;
478
479 let market_scope = MarketScope(&client);
480
481 market_scope.timestamp(|b| b).await.unwrap();
482 }
483
484 #[tokio::test]
485 async fn racing_cars() {
486 let client = test_client().await;
487
488 let racing_scope = RacingScope(&client);
489
490 racing_scope.cars(|b| b).await.unwrap();
491 }
492
493 #[tokio::test]
494 async fn racing_carupgrades() {
495 let client = test_client().await;
496
497 let racing_scope = RacingScope(&client);
498
499 racing_scope.carupgrades(|b| b).await.unwrap();
500 }
501
502 #[tokio::test]
512 async fn racing_race_for_race_id() {
513 let client = test_client().await;
514
515 let racing_scope = RacingScope(&client);
516
517 racing_scope
518 .race_for_race_id(14650821.into(), |b| b)
519 .await
520 .unwrap();
521 }
522
523 #[tokio::test]
524 async fn racing_tracks() {
525 let client = test_client().await;
526
527 let racing_scope = RacingScope(&client);
528
529 racing_scope.tracks(|b| b).await.unwrap();
530 }
531
532 #[tokio::test]
533 async fn racing_lookup() {
534 let client = test_client().await;
535
536 let racing_scope = RacingScope(&client);
537
538 racing_scope.lookup(|b| b).await.unwrap();
539 }
540
541 #[tokio::test]
542 async fn racing_timestamp() {
543 let client = test_client().await;
544
545 let racing_scope = RacingScope(&client);
546
547 racing_scope.timestamp(|b| b).await.unwrap();
548 }
549
550 #[tokio::test]
551 async fn torn_attacklog() {
552 let client = test_client().await;
553
554 let racing_scope = TornScope(&client);
555
556 racing_scope
557 .attacklog(|b| b.log(AttackCode("ec987a60a22155cbfb7c1625cbb2092f".to_owned())))
558 .await
559 .unwrap();
560 }
561
562 #[tokio::test]
563 async fn torn_bounties() {
564 let client = test_client().await;
565
566 let torn_scope = TornScope(&client);
567
568 torn_scope.bounties(|b| b).await.unwrap();
569 }
570
571 #[tokio::test]
572 async fn torn_calendar() {
573 let client = test_client().await;
574
575 let torn_scope = TornScope(&client);
576
577 torn_scope.calendar(|b| b).await.unwrap();
578 }
579
580 #[tokio::test]
581 async fn torn_crimes() {
582 let client = test_client().await;
583
584 let torn_scope = TornScope(&client);
585
586 torn_scope.crimes(|b| b).await.unwrap();
587 }
588
589 #[tokio::test]
590 async fn torn_factionhof() {
591 let client = test_client().await;
592
593 let torn_scope = TornScope(&client);
594
595 torn_scope
596 .factionhof(|b| b.cat(crate::models::TornFactionHofCategory::Rank))
597 .await
598 .unwrap();
599 }
600
601 #[tokio::test]
602 async fn torn_factiontree() {
603 let client = test_client().await;
604
605 let torn_scope = TornScope(&client);
606
607 torn_scope.factiontree(|b| b).await.unwrap();
608 }
609
610 #[tokio::test]
611 async fn torn_hof() {
612 let client = test_client().await;
613
614 let torn_scope = TornScope(&client);
615
616 torn_scope
617 .hof(|b| b.cat(crate::models::TornHofCategory::Offences))
618 .await
619 .unwrap();
620 }
621
622 #[tokio::test]
623 async fn torn_itemammo() {
624 let client = test_client().await;
625
626 let torn_scope = TornScope(&client);
627
628 torn_scope.itemammo(|b| b).await.unwrap();
629 }
630
631 #[tokio::test]
632 async fn torn_itemmods() {
633 let client = test_client().await;
634
635 let torn_scope = TornScope(&client);
636
637 torn_scope.itemmods(|b| b).await.unwrap();
638 }
639
640 #[tokio::test]
641 async fn torn_items() {
642 let client = test_client().await;
643
644 let torn_scope = TornScope(&client);
645
646 torn_scope.items(|b| b).await.unwrap();
647 }
648
649 #[tokio::test]
650 async fn torn_items_for_ids() {
651 let client = test_client().await;
652
653 let torn_scope = TornScope(&client);
654
655 torn_scope.items_for_ids([1].into(), |b| b).await.unwrap();
656 }
657
658 #[tokio::test]
659 async fn torn_logcategories() {
660 let client = test_client().await;
661
662 let torn_scope = TornScope(&client);
663
664 torn_scope.logcategories(|b| b).await.unwrap();
665 }
666
667 #[tokio::test]
668 async fn torn_logtypes() {
669 let client = test_client().await;
670
671 let torn_scope = TornScope(&client);
672
673 torn_scope.logtypes(|b| b).await.unwrap();
674 }
675
676 #[tokio::test]
677 async fn torn_logtypes_for_log_category_id() {
678 let client = test_client().await;
679
680 let torn_scope = TornScope(&client);
681
682 torn_scope
683 .logtypes_for_log_category_id(23.into(), |b| b)
684 .await
685 .unwrap();
686 }
687
688 #[tokio::test]
689 async fn torn_subrcimes_for_crime_id() {
690 let client = test_client().await;
691
692 let torn_scope = TornScope(&client);
693
694 torn_scope
695 .subcrimes_for_crime_id(3.into(), |b| b)
696 .await
697 .unwrap();
698 }
699
700 #[tokio::test]
701 async fn torn_lookup() {
702 let client = test_client().await;
703 let torn_scope = TornScope(&client);
704
705 torn_scope.lookup(|b| b).await.unwrap();
706 }
707
708 #[tokio::test]
709 async fn torn_timestamp() {
710 let client = test_client().await;
711
712 let torn_scope = TornScope(&client);
713
714 torn_scope.timestamp(|b| b).await.unwrap();
715 }
716
717 #[tokio::test]
718 async fn user_attacks() {
719 let client = test_client().await;
720
721 client.user().attacks(|b| b).await.unwrap();
722 }
723
724 #[tokio::test]
725 async fn user_attacksfull() {
726 let client = test_client().await;
727
728 client.user().attacksfull(|b| b).await.unwrap();
729 }
730
731 #[tokio::test]
732 async fn user_bounties() {
733 let client = test_client().await;
734
735 client.user().bounties(|b| b).await.unwrap();
736 }
737
738 #[tokio::test]
739 async fn user_bounties_for_id() {
740 let client = test_client().await;
741
742 client
743 .user()
744 .bounties_for_id(986228.into(), |b| b)
745 .await
746 .unwrap();
747 }
748
749 #[tokio::test]
750 async fn user_calendar() {
751 let client = test_client().await;
752
753 client.user().calendar(|b| b).await.unwrap();
754 }
755
756 #[tokio::test]
757 async fn user_crimes_for_crime_id() {
758 let client = test_client().await;
759
760 client
761 .user()
762 .crimes_for_crime_id(10.into(), |b| b)
763 .await
764 .unwrap();
765 }
766
767 #[tokio::test]
768 async fn user_enlisted_cars() {
769 let client = test_client().await;
770
771 client.user().enlistedcars(|b| b).await.unwrap();
772 }
773
774 #[tokio::test]
775 async fn user_factionbalance() {
776 let client = test_client().await;
777
778 client.user().factionbalance(|b| b).await.unwrap();
779 }
780
781 #[tokio::test]
782 async fn user_forumfeed() {
783 let client = test_client().await;
784
785 client.user().forumfeed(|b| b).await.unwrap();
786 }
787
788 #[tokio::test]
789 async fn user_forumfriends() {
790 let client = test_client().await;
791
792 client.user().forumfriends(|b| b).await.unwrap();
793 }
794
795 #[tokio::test]
796 async fn user_forumposts() {
797 let client = test_client().await;
798
799 client.user().forumposts(|b| b).await.unwrap();
800 }
801
802 #[tokio::test]
803 async fn user_forumposts_for_id() {
804 let client = test_client().await;
805
806 client
807 .user()
808 .forumposts_for_id(1.into(), |b| b)
809 .await
810 .unwrap();
811 }
812
813 #[tokio::test]
814 async fn user_forumsubscribedthreads() {
815 let client = test_client().await;
816
817 client.user().forumsubscribedthreads(|b| b).await.unwrap();
818 }
819
820 #[tokio::test]
821 async fn user_forumthreads() {
822 let client = test_client().await;
823
824 client.user().forumthreads(|b| b).await.unwrap();
825 }
826
827 #[tokio::test]
828 async fn user_forumthreads_for_id() {
829 let client = test_client().await;
830
831 client
832 .user()
833 .forumthreads_for_id(1.into(), |b| b)
834 .await
835 .unwrap();
836 }
837
838 #[tokio::test]
839 async fn user_hof() {
840 let client = test_client().await;
841
842 client.user().hof(|b| b).await.unwrap();
843 }
844
845 #[tokio::test]
846 async fn user_hof_for_id() {
847 let client = test_client().await;
848
849 client.user().hof_for_id(1.into(), |b| b).await.unwrap();
850 }
851
852 #[tokio::test]
853 async fn user_itemmarket() {
854 let client = test_client().await;
855
856 client.user().itemmarket(|b| b).await.unwrap();
857 }
858
859 #[tokio::test]
860 async fn user_jobranks() {
861 let client = test_client().await;
862
863 client.user().jobranks(|b| b).await.unwrap();
864 }
865
866 #[tokio::test]
867 async fn user_list() {
868 let client = test_client().await;
869
870 client
871 .user()
872 .list(|b| b.cat(UserListEnum::Friends))
873 .await
874 .unwrap();
875 }
876
877 #[tokio::test]
878 async fn user_organizedcrime() {
879 let client = test_client().await;
880
881 client.user().organizedcrime(|b| b).await.unwrap();
882 }
883
884 #[tokio::test]
885 async fn user_personalstats() {
886 let client = test_client().await;
887
888 client
889 .user()
890 .personalstats(|b| {
891 b.stat([PersonalStatsStatName::Piercinghits])
892 .timestamp(1737661955)
893 })
894 .await
895 .unwrap();
896
897 client
898 .user()
899 .personalstats(|b| b.cat(PersonalStatsCategoryEnum::All))
900 .await
901 .unwrap();
902
903 client
904 .user()
905 .personalstats(|b| b.cat(PersonalStatsCategoryEnum::Popular))
906 .await
907 .unwrap();
908
909 client
910 .user()
911 .personalstats(|b| b.cat(PersonalStatsCategoryEnum::Drugs))
912 .await
913 .unwrap();
914
915 client
916 .user()
917 .personalstats(|b| b.stat([PersonalStatsStatName::Piercinghits]))
918 .await
919 .unwrap();
920 }
921
922 #[cfg(feature = "strum")]
923 #[tokio::test]
924 async fn user_personalstats_popular() {
925 let client = test_client().await;
926
927 let resp = client
928 .user()
929 .for_selections(|b| {
930 b.selections([UserSelectionNameVariant::Personalstats])
931 .cat(PersonalStatsCategoryEnum::Popular)
932 })
933 .await
934 .unwrap();
935
936 assert!(resp
937 .user_personal_stats_response()
938 .unwrap()
939 .is_user_personal_stats_popular());
940 }
941
942 #[cfg(feature = "strum")]
943 #[tokio::test]
944 async fn user_personalstats_all() {
945 let client = test_client().await;
946
947 let resp = client
948 .user()
949 .for_selections(|b| {
950 b.selections([UserSelectionNameVariant::Personalstats])
951 .cat(PersonalStatsCategoryEnum::All)
952 })
953 .await
954 .unwrap();
955
956 assert!(resp
957 .user_personal_stats_response()
958 .unwrap()
959 .is_user_personal_stats_full());
960 }
961
962 #[cfg(feature = "strum")]
963 #[tokio::test]
964 async fn user_personalstats_cat_attacking() {
965 let client = test_client().await;
966
967 let resp = client
968 .user()
969 .for_selections(|b| {
970 b.selections([UserSelectionNameVariant::Personalstats])
971 .cat(PersonalStatsCategoryEnum::Attacking)
972 })
973 .await
974 .unwrap();
975
976 assert!(resp
977 .user_personal_stats_response()
978 .unwrap()
979 .try_as_user_personal_stats_category()
980 .unwrap()
981 .personalstats
982 .is_personal_stats_attacking_public());
983 }
984
985 #[cfg(feature = "strum")]
986 #[tokio::test]
987 async fn user_personalstats_cat_jobs() {
988 let client = test_client().await;
989
990 let resp = client
991 .user()
992 .for_selections(|b| {
993 b.selections([UserSelectionNameVariant::Personalstats])
994 .cat(PersonalStatsCategoryEnum::Jobs)
995 })
996 .await
997 .unwrap();
998
999 assert!(resp
1000 .user_personal_stats_response()
1001 .unwrap()
1002 .try_as_user_personal_stats_category()
1003 .unwrap()
1004 .personalstats
1005 .is_personal_stats_jobs_public());
1006 }
1007
1008 #[cfg(feature = "strum")]
1009 #[tokio::test]
1010 async fn user_personalstats_cat_trading() {
1011 let client = test_client().await;
1012
1013 let resp = client
1014 .user()
1015 .for_selections(|b| {
1016 b.selections([UserSelectionNameVariant::Personalstats])
1017 .cat(PersonalStatsCategoryEnum::Trading)
1018 })
1019 .await
1020 .unwrap();
1021
1022 assert!(resp
1023 .user_personal_stats_response()
1024 .unwrap()
1025 .try_as_user_personal_stats_category()
1026 .unwrap()
1027 .personalstats
1028 .is_personal_stats_trading());
1029 }
1030
1031 #[cfg(feature = "strum")]
1032 #[tokio::test]
1033 async fn user_personalstats_cat_jail() {
1034 let client = test_client().await;
1035
1036 let resp = client
1037 .user()
1038 .for_selections(|b| {
1039 b.selections([UserSelectionNameVariant::Personalstats])
1040 .cat(PersonalStatsCategoryEnum::Jail)
1041 })
1042 .await
1043 .unwrap();
1044
1045 assert!(resp
1046 .user_personal_stats_response()
1047 .unwrap()
1048 .try_as_user_personal_stats_category()
1049 .unwrap()
1050 .personalstats
1051 .is_personal_stats_jail());
1052 }
1053
1054 #[cfg(feature = "strum")]
1055 #[tokio::test]
1056 async fn user_personalstats_cat_hospital() {
1057 let client = test_client().await;
1058
1059 let resp = client
1060 .user()
1061 .for_selections(|b| {
1062 b.selections([UserSelectionNameVariant::Personalstats])
1063 .cat(PersonalStatsCategoryEnum::Hospital)
1064 })
1065 .await
1066 .unwrap();
1067
1068 assert!(resp
1069 .user_personal_stats_response()
1070 .unwrap()
1071 .try_as_user_personal_stats_category()
1072 .unwrap()
1073 .personalstats
1074 .is_personal_stats_hospital());
1075 }
1076
1077 #[tokio::test]
1078 async fn user_personalstats_for_id() {
1079 let client = test_client().await;
1080
1081 client
1082 .user()
1083 .personalstats_for_id(1.into(), |b| b.cat(PersonalStatsCategoryEnum::All))
1084 .await
1085 .unwrap();
1086 }
1087
1088 #[tokio::test]
1089 async fn user_races() {
1090 let client = test_client().await;
1091
1092 client.user().races(|b| b).await.unwrap();
1093 }
1094
1095 #[tokio::test]
1096 async fn user_revives() {
1097 let client = test_client().await;
1098
1099 client.user().revives(|b| b).await.unwrap();
1100 }
1101
1102 #[tokio::test]
1103 async fn user_revivesfull() {
1104 let client = test_client().await;
1105
1106 client.user().revives_full(|b| b).await.unwrap();
1107 }
1108
1109 #[tokio::test]
1110 async fn user_lookup() {
1111 let client = test_client().await;
1112
1113 client.user().lookup(|b| b).await.unwrap();
1114 }
1115
1116 #[tokio::test]
1117 async fn user_timestamp() {
1118 let client = test_client().await;
1119
1120 client.user().attacks(|b| b).await.unwrap();
1121 }
1122
1123 #[tokio::test]
1124 async fn user_reports() {
1125 let client = test_client().await;
1126
1127 client.user().reports(|b| b).await.unwrap();
1128 }
1129
1130 #[tokio::test]
1131 async fn key_info() {
1132 let client = test_client().await;
1133
1134 client.key().info(|b| b).await.unwrap();
1135 }
1136
1137 #[tokio::test]
1138 async fn key_log() {
1139 let client = test_client().await;
1140
1141 client.key().log(|b| b).await.unwrap();
1142 }
1143}