use crate::base::sample;
use crate::locale::fetch_locale;
pub fn hero() -> String {
fetch_locale("world_of_warcraft.heros", "en")
.map(|v| sample(&v))
.unwrap_or_else(|| "Thrall".to_string())
}
pub fn quote() -> String {
fetch_locale("world_of_warcraft.quotes", "en")
.map(|v| sample(&v))
.unwrap_or_else(|| "For the Horde!".to_string())
}
pub fn class_name() -> String {
fetch_locale("world_of_warcraft.class_names", "en")
.map(|v| sample(&v))
.unwrap_or_else(|| "Paladin".to_string())
}
pub fn race() -> String {
fetch_locale("world_of_warcraft.races", "en")
.map(|v| sample(&v))
.unwrap_or_else(|| "Orc".to_string())
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_wow_generation() {
assert!(!hero().is_empty());
assert!(!quote().is_empty());
assert!(!class_name().is_empty());
assert!(!race().is_empty());
}
}