use weather_man::modules::forecaster::WeatherForecaster;
use weather_man::modules::types::WeatherConfig;
#[test]
#[ignore]
fn test_location_service_get_location_by_name() {
}
#[test]
#[ignore]
fn test_forecast_api() {
}
#[test]
fn test_weather_condition_mapping() {
let config = WeatherConfig::default();
let forecaster = WeatherForecaster::new(config);
let clear = forecaster.wmo_code_to_condition(0);
assert_eq!(clear, weather_man::modules::types::WeatherCondition::Clear);
let clouds = forecaster.wmo_code_to_condition(2);
assert_eq!(
clouds,
weather_man::modules::types::WeatherCondition::Clouds
);
let rain = forecaster.wmo_code_to_condition(61);
assert_eq!(rain, weather_man::modules::types::WeatherCondition::Rain);
let snow = forecaster.wmo_code_to_condition(71);
assert_eq!(snow, weather_man::modules::types::WeatherCondition::Snow);
let thunder = forecaster.wmo_code_to_condition(95);
assert_eq!(
thunder,
weather_man::modules::types::WeatherCondition::Thunderstorm
);
let desc_clear = forecaster.get_weather_description_from_wmo(0, true);
assert_eq!(desc_clear.main, "Clear");
assert_eq!(desc_clear.description, "Clear sky");
assert_eq!(desc_clear.icon, "01d");
let desc_clouds = forecaster.get_weather_description_from_wmo(3, true);
assert_eq!(desc_clouds.main, "Clouds");
assert_eq!(desc_clouds.description, "Overcast");
let desc_clear_night = forecaster.get_weather_description_from_wmo(0, false);
assert_eq!(desc_clear_night.icon, "01n");
}