diff --git a/src/configure/auto_outlook.rs b/src/configure/auto_outlook.rs index 9ffb440b9..31044cce2 100644 --- a/src/configure/auto_outlook.rs +++ b/src/configure/auto_outlook.rs @@ -201,4 +201,47 @@ mod tests { } } } + + #[test] + fn test_parse_loginparam() { + let res = outlk_parse_xml( + "\ + + + + + email + settings + + IMAP + example.com + 993 + on + on + + + SMTP + smtp.example.com + 25 + off + on + + + +", + ) + .expect("XML is not parsed successfully"); + + match res { + ParsingResult::LoginParam(lp) => { + assert_eq!(lp.mail_server, "example.com"); + assert_eq!(lp.mail_port, 993); + assert_eq!(lp.send_server, "smtp.example.com"); + assert_eq!(lp.send_port, 25); + } + ParsingResult::RedirectUrl(_) => { + panic!("RedirectUrl is not expected"); + } + } + } }