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