use tse_client::{Client, Config, IntradaySettings, PriceSettings};
#[test]
fn public_api_constructs() {
let _ = Config::default();
let _ = PriceSettings::default();
let _ = IntradaySettings::default();
let _client = Client::new().expect("client construction should succeed");
}
#[tokio::test]
#[ignore = "hits the live TSETMC network"]
async fn get_instruments_live() {
let client = Client::new().unwrap();
let instruments = client.get_instruments().await.unwrap();
assert!(!instruments.is_empty(), "expected at least one instrument");
}
#[tokio::test]
#[ignore = "hits the live TSETMC network"]
async fn get_prices_live() {
let client = Client::new().unwrap();
let symbols = vec!["فملی".to_string()];
let res = client
.get_prices(&symbols, &PriceSettings::default())
.await
.unwrap();
assert!(res.error.is_none(), "unexpected error: {:?}", res.error);
assert_eq!(res.data.len(), symbols.len());
}
#[tokio::test]
#[ignore = "hits the live TSETMC network"]
async fn get_intraday_live() {
let client = Client::new().unwrap();
let symbols = vec!["فملی".to_string()];
let res = client
.get_intraday(&symbols, &IntradaySettings::default())
.await
.unwrap();
assert_eq!(res.data.len(), symbols.len());
}