use std::assert_matches;
use super::Version;
use crate::{json, tariff, test, Versioned as _};
#[test]
fn should_guess_tariff_version_v211() {
const JSON: &str = include_str!("../../test_data/v211/every_field_set/tariff.json");
test::setup();
let tariff = json::parse_object(JSON).unwrap();
let version = tariff::infer_version(tariff);
let Version::Certain(tariff) = version else {
panic!("expected a certain version, got {version:?}");
};
assert_matches!(tariff.version(), crate::Version::V211);
}
#[test]
fn should_guess_tariff_version_v221() {
const JSON: &str = include_str!("../../test_data/v221/every_field_set/tariff.json");
test::setup();
let tariff = json::parse_object(JSON).unwrap();
let version = tariff::infer_version(tariff);
let Version::Certain(tariff) = version else {
panic!("expected a certain version, got {version:?}");
};
assert_matches!(tariff.version(), crate::Version::V221);
}