Cotton code
20 lines · 967 B · RustRaw
//! People on an event (CONTRACT.md section 15), over invented people.use super::*;#[test]fn the_route_is_cotton_for_a_connected_number_google_for_an_email_and_none_without_a_calendar() {    assert_eq!(route(Some("+447700900001"), Some("a@example.test"), true, true), Some(Via::Cotton));    assert_eq!(route(Some("+447700900001"), Some("a@example.test"), false, true), Some(Via::Google));    assert_eq!(route(None, Some("a@example.test"), false, false), Some(Via::None));    assert_eq!(route(Some("+447700900001"), None, false, true), None);}#[test]fn names_join_plainly_and_an_email_is_checked() {    assert_eq!(names(&["Priya".into(), "Akash".into(), "Rose".into()]), "Priya, Akash and Rose");    assert_eq!(names(&["Priya".into(), "Akash".into()]), "Priya and Akash");    assert_eq!(email_key(" Priya@Example.Test "), Some("priya@example.test".into()));    assert_eq!(email_key("priya"), None);    assert_eq!(email_key("priya@example"), None);}