diff --git a/tests/test_config.rs b/tests/test_config.rs index 75568aa..83f99e3 100644 --- a/tests/test_config.rs +++ b/tests/test_config.rs @@ -1,6 +1,7 @@ use helius::config::Config; use helius::error::{HeliusError, Result}; use helius::types::Cluster; +use helius::Helius; #[test] fn test_config_new_with_empty_api_key() { @@ -18,3 +19,25 @@ fn test_config_new_with_valid_api_key() { assert_eq!(config.endpoints.api, "https://api-devnet.helius-rpc.com/"); assert_eq!(config.endpoints.rpc, "https://devnet.helius-rpc.com/"); } + +#[test] +fn test_create_basic_client() { + let config: Config = Config::new("valid-api-key", Cluster::Devnet).unwrap(); + let result: Result = config.create_client(); + assert!(result.is_ok()); + + let client: Helius = result.unwrap(); + assert!(client.async_rpc_client.is_none()); + assert!(client.ws_client.is_none()); +} + +#[test] +fn test_create_async_client() { + let config: Config = Config::new("valid-api-key", Cluster::Devnet).unwrap(); + let result: Result = config.create_client_with_async(); + assert!(result.is_ok()); + + let client: Helius = result.unwrap(); + assert!(client.async_rpc_client.is_some()); + assert!(client.ws_client.is_none()); +}