mod gmail_client_tests {
use cull_gmail::ClientConfig;
#[test]
fn test_default_max_results() {
let default_max = cull_gmail::DEFAULT_MAX_RESULTS;
assert_eq!(default_max, "200");
let parsed: u32 = default_max
.parse()
.expect("DEFAULT_MAX_RESULTS should be a valid u32");
assert_eq!(parsed, 200);
}
#[test]
fn test_default_max_results_range() {
let default_max: u32 = cull_gmail::DEFAULT_MAX_RESULTS
.parse()
.expect("DEFAULT_MAX_RESULTS should be a valid u32");
assert!(default_max > 0, "Max results should be positive");
assert!(
default_max <= 500,
"Max results should not exceed Gmail API limit"
);
assert!(
default_max >= 10,
"Max results should be reasonable for performance"
);
}
#[test]
fn test_client_config_builder_works() {
let _config = ClientConfig::builder()
.with_client_id("test-id")
.with_client_secret("test-secret")
.build();
}
}