aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoralpaylan2021-04-14 02:38:00 +0300
committeralpaylan2021-04-14 02:38:00 +0300
commit882f0cd4dea0b29a4de10ea74b4579a830104775 (patch)
treef6652feb6a58f8e9ce9912b9cff187bfaafda92d /tests
parentc9209d1c311e1527c0531c995c6ebae7cc5accca (diff)
downloadgradecoin-882f0cd4dea0b29a4de10ea74b4579a830104775.tar.gz
gradecoin-882f0cd4dea0b29a4de10ea74b4579a830104775.tar.bz2
gradecoin-882f0cd4dea0b29a4de10ea74b4579a830104775.zip
finished metu id testing.
Diffstat (limited to 'tests')
-rw-r--r--tests/schema_tests.rs14
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]