Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hocuri committed May 14, 2020
1 parent 9239a3f commit 95eafa9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/contact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,11 @@ mod tests {
assert_eq!(contact.get_name(), "Dave Mueller");
assert_eq!(contact.get_addr(), "dave@example.org");

let contact_id = Contact::create(&t.ctx, "name1", "name2 <dave@example.org>").unwrap();
let contact = Contact::load_from_db(&t.ctx, contact_id).unwrap();
assert_eq!(contact.get_name(), "name1");
assert_eq!(contact.get_addr(), "dave@example.org");

assert!(Contact::create(&t.ctx, "", "<dskjfdslk@sadklj.dk").is_err());
assert!(Contact::create(&t.ctx, "", "<dskjf>dslk@sadklj.dk>").is_err());
assert!(Contact::create(&t.ctx, "", "dskjfdslksadklj.dk").is_err());
Expand Down

0 comments on commit 95eafa9

Please sign in to comment.