use std::collections::HashMap;

#[derive(Debug)]
#[cfg_attr(test, derive(PartialEq))]
pub struct Cookie {
    pub cookies: HashMap<String, String>,
}

impl Cookie {
    pub fn new(cookies: HashMap<String, String>) -> Self {
        return Cookie { cookies };
    }
}

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

    #[test]
    fn test_new() {
        let cookies = HashMap::from([("k1".to_owned(), "v1".to_owned()), ("k2".to_owned(), "v2".to_owned())]);
        let cookie = Cookie::new(cookies.clone());
        assert_eq!(cookies, cookie.cookies);
    }
}
