diff options
-rw-r--r-- | tests/schema_tests.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/schema_tests.rs b/tests/schema_tests.rs index 23537fb..7fbbba0 100644 --- a/tests/schema_tests.rs +++ b/tests/schema_tests.rs | |||
@@ -220,12 +220,26 @@ mod tests { | |||
220 | 220 | ||
221 | #[test] | 221 | #[test] |
222 | fn metu_id_serialize_correctly() { | 222 | fn metu_id_serialize_correctly() { |
223 | let metu_id = MetuId::new ("e254275".to_owned()).unwrap(); | ||
223 | 224 | ||
225 | assert_tokens( | ||
226 | &metu_id, | ||
227 | &[ | ||
228 | Token::Struct{name: "MetuId", len: 1}, | ||
229 | Token::String("id"), | ||
230 | Token::String("e254275"), | ||
231 | Token::StructEnd, | ||
232 | ] | ||
233 | ) | ||
224 | } | 234 | } |
225 | 235 | ||
226 | #[test] | 236 | #[test] |
227 | fn metu_id_deserialize_correctly() { | 237 | fn metu_id_deserialize_correctly() { |
238 | let expected_metu_id = MetuId::new ("e254275".to_owned()).unwrap(); | ||
239 | let data = r#"{"{"id":"e254275"}"#; | ||
240 | let metu_id: MetuId = serde_json::from_str(data).unwrap(); | ||
228 | 241 | ||
242 | assert_eq!(metu_id, expected_metu_id); | ||
229 | } | 243 | } |
230 | 244 | ||
231 | #[test] | 245 | #[test] |