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 client
877 .user()
878 .list(|b| b.cat(UserListEnum::Enemies))
879 .await
880 .unwrap();
881
882 client
883 .user()
884 .list(|b| b.cat(UserListEnum::Targets))
885 .await
886 .unwrap();
887 }
888
889 #[tokio::test]
890 async fn user_organizedcrime() {
891 let client = test_client().await;
892
893 client.user().organizedcrime(|b| b).await.unwrap();
894 }
895
896 #[tokio::test]
897 async fn user_personalstats() {
898 let client = test_client().await;
899
900 client
901 .user()
902 .personalstats(|b| {
903 b.stat([PersonalStatsStatName::Piercinghits])
904 .timestamp(1737661955)
905 })
906 .await
907 .unwrap();
908
909 client
910 .user()
911 .personalstats(|b| b.cat(PersonalStatsCategoryEnum::All))
912 .await
913 .unwrap();
914
915 client
916 .user()
917 .personalstats(|b| b.cat(PersonalStatsCategoryEnum::Popular))
918 .await
919 .unwrap();
920
921 client
922 .user()
923 .personalstats(|b| b.cat(PersonalStatsCategoryEnum::Drugs))
924 .await
925 .unwrap();
926
927 client
928 .user()
929 .personalstats(|b| b.stat([PersonalStatsStatName::Piercinghits]))
930 .await
931 .unwrap();
932 }
933
934 #[cfg(feature = "strum")]
935 #[tokio::test]
936 async fn user_personalstats_popular() {
937 let client = test_client().await;
938
939 let resp = client
940 .user()
941 .for_selections(|b| {
942 b.selections([UserSelectionNameVariant::Personalstats])
943 .cat(PersonalStatsCategoryEnum::Popular)
944 })
945 .await
946 .unwrap();
947
948 assert!(resp
949 .user_personal_stats_response()
950 .unwrap()
951 .is_user_personal_stats_popular());
952 }
953
954 #[cfg(feature = "strum")]
955 #[tokio::test]
956 async fn user_personalstats_all() {
957 let client = test_client().await;
958
959 let resp = client
960 .user()
961 .for_selections(|b| {
962 b.selections([UserSelectionNameVariant::Personalstats])
963 .cat(PersonalStatsCategoryEnum::All)
964 })
965 .await
966 .unwrap();
967
968 assert!(resp
969 .user_personal_stats_response()
970 .unwrap()
971 .is_user_personal_stats_full());
972 }
973
974 #[cfg(feature = "strum")]
975 #[tokio::test]
976 async fn user_personalstats_cat_attacking() {
977 let client = test_client().await;
978
979 let resp = client
980 .user()
981 .for_selections(|b| {
982 b.selections([UserSelectionNameVariant::Personalstats])
983 .cat(PersonalStatsCategoryEnum::Attacking)
984 })
985 .await
986 .unwrap();
987
988 assert!(resp
989 .user_personal_stats_response()
990 .unwrap()
991 .try_as_user_personal_stats_category()
992 .unwrap()
993 .personalstats
994 .is_personal_stats_attacking_public());
995 }
996
997 #[cfg(feature = "strum")]
998 #[tokio::test]
999 async fn user_personalstats_cat_jobs() {
1000 let client = test_client().await;
1001
1002 let resp = client
1003 .user()
1004 .for_selections(|b| {
1005 b.selections([UserSelectionNameVariant::Personalstats])
1006 .cat(PersonalStatsCategoryEnum::Jobs)
1007 })
1008 .await
1009 .unwrap();
1010
1011 assert!(resp
1012 .user_personal_stats_response()
1013 .unwrap()
1014 .try_as_user_personal_stats_category()
1015 .unwrap()
1016 .personalstats
1017 .is_personal_stats_jobs_public());
1018 }
1019
1020 #[cfg(feature = "strum")]
1021 #[tokio::test]
1022 async fn user_personalstats_cat_trading() {
1023 let client = test_client().await;
1024
1025 let resp = client
1026 .user()
1027 .for_selections(|b| {
1028 b.selections([UserSelectionNameVariant::Personalstats])
1029 .cat(PersonalStatsCategoryEnum::Trading)
1030 })
1031 .await
1032 .unwrap();
1033
1034 assert!(resp
1035 .user_personal_stats_response()
1036 .unwrap()
1037 .try_as_user_personal_stats_category()
1038 .unwrap()
1039 .personalstats
1040 .is_personal_stats_trading());
1041 }
1042
1043 #[cfg(feature = "strum")]
1044 #[tokio::test]
1045 async fn user_personalstats_cat_jail() {
1046 let client = test_client().await;
1047
1048 let resp = client
1049 .user()
1050 .for_selections(|b| {
1051 b.selections([UserSelectionNameVariant::Personalstats])
1052 .cat(PersonalStatsCategoryEnum::Jail)
1053 })
1054 .await
1055 .unwrap();
1056
1057 assert!(resp
1058 .user_personal_stats_response()
1059 .unwrap()
1060 .try_as_user_personal_stats_category()
1061 .unwrap()
1062 .personalstats
1063 .is_personal_stats_jail());
1064 }
1065
1066 #[cfg(feature = "strum")]
1067 #[tokio::test]
1068 async fn user_personalstats_cat_hospital() {
1069 let client = test_client().await;
1070
1071 let resp = client
1072 .user()
1073 .for_selections(|b| {
1074 b.selections([UserSelectionNameVariant::Personalstats])
1075 .cat(PersonalStatsCategoryEnum::Hospital)
1076 })
1077 .await
1078 .unwrap();
1079
1080 assert!(resp
1081 .user_personal_stats_response()
1082 .unwrap()
1083 .try_as_user_personal_stats_category()
1084 .unwrap()
1085 .personalstats
1086 .is_personal_stats_hospital());
1087 }
1088
1089 #[tokio::test]
1090 async fn user_personalstats_for_id() {
1091 let client = test_client().await;
1092
1093 client
1094 .user()
1095 .personalstats_for_id(1.into(), |b| b.cat(PersonalStatsCategoryEnum::All))
1096 .await
1097 .unwrap();
1098 }
1099
1100 #[tokio::test]
1101 async fn user_races() {
1102 let client = test_client().await;
1103
1104 client.user().races(|b| b).await.unwrap();
1105 }
1106
1107 #[tokio::test]
1108 async fn user_revives() {
1109 let client = test_client().await;
1110
1111 client.user().revives(|b| b).await.unwrap();
1112 }
1113
1114 #[tokio::test]
1115 async fn user_revivesfull() {
1116 let client = test_client().await;
1117
1118 client.user().revives_full(|b| b).await.unwrap();
1119 }
1120
1121 #[tokio::test]
1122 async fn user_lookup() {
1123 let client = test_client().await;
1124
1125 client.user().lookup(|b| b).await.unwrap();
1126 }
1127
1128 #[tokio::test]
1129 async fn user_timestamp() {
1130 let client = test_client().await;
1131
1132 client.user().attacks(|b| b).await.unwrap();
1133 }
1134
1135 #[tokio::test]
1136 async fn user_reports() {
1137 let client = test_client().await;
1138
1139 client.user().reports(|b| b).await.unwrap();
1140 }
1141
1142 #[tokio::test]
1143 async fn user_profile() {
1144 let client = test_client().await;
1145
1146 client.user().profile(|b| b).await.unwrap();
1147 }
1148
1149 #[tokio::test]
1150 async fn key_info() {
1151 let client = test_client().await;
1152
1153 client.key().info(|b| b).await.unwrap();
1154 }
1155
1156 #[tokio::test]
1157 async fn key_log() {
1158 let client = test_client().await;
1159
1160 client.key().log(|b| b).await.unwrap();
1161 }
1162}