#[derive(Debug)]
#[cfg_attr(test, derive(PartialEq))]
pub struct UserAgent {
    pub value: String,
}

impl UserAgent {
    pub fn new(value: impl Into<String>) -> Self {
        Self { value: value.into() }
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_new() {
        const VALUE: &str = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0";
        let ua = UserAgent::new(VALUE.to_owned());
        assert_eq!(VALUE, ua.value);
    }
}
