use crate::{
constants::DEFAULT_ENVIRONMENT,
handlers::{handle_success, SuccessType},
utils::prompts::TokenInfo,
};
#[test]
fn test_token_creation_success_message() {
let token_info = TokenInfo {
decimals: 6, symbol: "TEST".to_string(), name: "Test Token".to_string(), description: "A test token for database storage".to_string(), is_frozen: false, environment: "mainnet".to_string(), };
let success_type =
SuccessType::TokenCreated(token_info, "Contract has been generated!".to_string());
handle_success(success_type);
}
#[test]
fn test_token_verification_success_message_path() {
let success_type = SuccessType::TokenVerified {
path: Some("./test_token".to_string()), url: None, address: None, environment: None, file_name: None, };
handle_success(success_type);
}
#[test]
fn test_token_verification_success_message_url() {
let success_type = SuccessType::TokenVerified {
path: None, url: Some("https://example.com/token".to_string()), address: None, environment: None, file_name: None, };
handle_success(success_type);
}
#[test]
fn test_token_info_parameter_capture() {
let token_info = TokenInfo {
decimals: 8, symbol: "STORE".to_string(), name: "Storage Token".to_string(), description: "Testing parameter capture for database storage".to_string(), is_frozen: true, environment: DEFAULT_ENVIRONMENT.to_string(), };
let success_type =
SuccessType::TokenCreated(token_info, "Contract has been generated!".to_string());
handle_success(success_type);
}