()
| 303 | |
| 304 | #[test] |
| 305 | fn test_json_author_serialize() { |
| 306 | let json_author = JsonAuthor { |
| 307 | name: "Charlie".to_string(), |
| 308 | email: Some("charlie@test.com".to_string()), |
| 309 | }; |
| 310 | let json = serde_json::to_string(&json_author).unwrap(); |
| 311 | assert!(json.contains("\"name\":\"Charlie\"")); |
| 312 | assert!(json.contains("\"email\":\"charlie@test.com\"")); |
| 313 | } |
| 314 | |
| 315 | #[test] |
| 316 | fn test_json_author_serialize_no_email() { |