1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
pub(crate) mod component;
pub mod model;
pub mod util;
pub mod types;
pub mod client;
#[cfg(test)]
mod tests {
use crate::client::Client;
use crate::types::Game;
// #[tokio::test]
// async fn game_power_barabra() {
// let mut client = Client::new();
// client.set_from_env().unwrap();
//
// let accounts = client.get_game_accounts(None)
// .await
// .unwrap();
//
// let g = accounts.iter().filter(|a| a.which_game().name().eq("genshin").clone()).next().unwrap();
// let h = accounts.iter().filter(|a| a.which_game().name().eq("hkrpg")).next().unwrap();
//
// let genshin = client.get_genshin_notes(Some(g.get_uid()), Some("ja-jp"))
// .await.unwrap();
// let starrail = client.get_starrail_notes(Some(h.get_uid()), Some("ja-jp"))
// .await.unwrap();
//
// println!("Genshin: [{}/{}]", genshin.current_resin, genshin.max_resin);
// println!("Starrail: [{}/{}]", starrail.current_stamina, starrail.max_stamina);
// }
#[tokio::test]
async fn starrail_notes() {
let mut client = Client::new();
client.set_from_env().unwrap();
let account = client.get_game_account(None, Game::STARRAIL)
.await
.unwrap();
let x = client.get_starrail_notes(Some(account.get_uid()), Some("ja-jp"))
.await
.unwrap();
dbg!(x);
}
// #[tokio::test]
// async fn starrail_user() {
// let mut client = Client::new();
// client.set_from_env().unwrap();
// let account = client.get_game_account(None, Game::STARRAIL)
// .await
// .unwrap();
//
// let x = client.get_starrail_user(Some(account.get_uid()), Some("ja-jp"))
// .await
// .unwrap();
// dbg!(x);
// }
// #[tokio::test]
// async fn starrail_challenges() {
// let mut client = Client::new();
// client.set_from_env().unwrap();
// let account = client.get_game_account(None, Game::STARRAIL)
// .await
// .unwrap();
//
// let x = client.get_starrail_challenge(Some(account.get_uid()), None, Some("ja-jp"))
// .await
// .unwrap();
// dbg!(x);
// }
// #[tokio::test]
// async fn starrail_rogue() {
// let mut client = Client::new();
// client.set_from_env().unwrap();
// let account = client.get_game_account(None, Game::STARRAIL)
// .await
// .unwrap();
//
// let x = client.get_starrail_rogue(Some(account.get_uid()), None, Some("ja-jp"))
// .await
// .unwrap();
// dbg!(x);
// }
// #[tokio::test]
// async fn genshin_notes() {
// let mut client = Client::new();
// client.set_from_env().unwrap();
// let account = client.get_game_account(None, Game::GENSHIN)
// .await
// .unwrap();
//
// let x = client.get_genshin_notes(Some(account.get_uid()), Some("ja-jp"))
// .await
// .unwrap();
// dbg!(x);
// }
//
// #[tokio::test]
// async fn genshin_partial_user() {
// let mut client = Client::new();
// client.set_from_env().unwrap();
// let account = client.get_game_account(None, Game::GENSHIN)
// .await
// .unwrap();
//
// let x = client.get_genshin_partial_user(Some(account.get_uid()), Some("ja-jp"))
// .await
// .unwrap();
// dbg!(x);
// }
//
//
// #[tokio::test]
// async fn genshin_characters() {
// let mut client = Client::new();
// client.set_from_env().unwrap();
// let account = client.get_game_account(None, Game::GENSHIN)
// .await
// .unwrap();
//
// let x = client.get_genshin_characters(Some(account.get_uid()), Some("ja-jp"))
// .await
// .unwrap();
// dbg!(x);
// }
//
//
// #[tokio::test]
// async fn genshin_user() {
// let mut client = Client::new();
// client.set_from_env().unwrap();
// let account = client.get_game_account(None, Game::GENSHIN)
// .await
// .unwrap();
//
// let x = client.get_genshin_user(Some(account.get_uid()), Some("ja-jp"))
// .await
// .unwrap();
// dbg!(x);
// }
//
// #[tokio::test]
// async fn genshin_spiral_abyss() {
// let mut client = Client::new();
// client.set_from_env().unwrap();
// let account = client.get_game_account(None, Game::GENSHIN)
// .await
// .unwrap();
//
// let x = client.get_genshin_spiral_abyss(Some(account.get_uid()), None, Some("ja-jp"))
// .await
// .unwrap();
// dbg!(x);
// }
}