diff options
author | alpaylan | 2021-04-14 02:38:00 +0300 |
---|---|---|
committer | alpaylan | 2021-04-14 02:38:00 +0300 |
commit | d4646efc091a0bda018244f451e68c5798c62462 (patch) | |
tree | a41e6be79fa5057668c69391960974f0cd921920 /tests | |
parent | 6007918adcff0a52748f8c4fb4154e904bc2d08a (diff) | |
download | gradecoin-d4646efc091a0bda018244f451e68c5798c62462.tar.gz gradecoin-d4646efc091a0bda018244f451e68c5798c62462.tar.bz2 gradecoin-d4646efc091a0bda018244f451e68c5798c62462.zip |
finished metu id testing.
Diffstat (limited to 'tests')
-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] |