torn_api/
scopes.rs

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