From 882f0cd4dea0b29a4de10ea74b4579a830104775 Mon Sep 17 00:00:00 2001 From: alpaylan Date: Wed, 14 Apr 2021 02:38:00 +0300 Subject: finished metu id testing. --- tests/schema_tests.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/schema_tests.rs') 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 { #[test] fn metu_id_serialize_correctly() { + let metu_id = MetuId::new ("e254275".to_owned()).unwrap(); + assert_tokens( + &metu_id, + &[ + Token::Struct{name: "MetuId", len: 1}, + Token::String("id"), + Token::String("e254275"), + Token::StructEnd, + ] + ) } #[test] fn metu_id_deserialize_correctly() { + let expected_metu_id = MetuId::new ("e254275".to_owned()).unwrap(); + let data = r#"{"{"id":"e254275"}"#; + let metu_id: MetuId = serde_json::from_str(data).unwrap(); + assert_eq!(metu_id, expected_metu_id); } #[test] -- cgit v1.2.3-70-g09d2