aboutsummaryrefslogtreecommitdiffstats
path: root/tests/schema_tests.rs
blob: c6fae9d9c11548a7b9f83b8704c0cbcee0719883 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#[cfg(test)]
mod tests {
    use gradecoin::schema::*;
    use serde_json::error::Error;
    use serde_test::{assert_tokens, Token};

    #[test]
    fn claims_serialize_correctly() {
        let claims = Claims {
            tha: "hashed_string".to_owned(),
            iat: 0,
            exp: 100,
        };
        assert_tokens(
            &claims,
            &[
                Token::Struct{name: "Claims", len: 3},
                Token::String("tha"),
                Token::String("hashed_string"),
                Token::String("iat"),
                Token::U64(0),
                Token::String("exp"),
                Token::U64(100),
                Token::StructEnd,
            ]
        )
    }

    #[test]
    fn claims_deserialize_correctly() {
        let data = r#"{"tha":"hashed_string","iat":0,"exp":100}"#;
        let claims: Claims = serde_json::from_str(data).unwrap();
        let expected_claims = Claims {
            tha: "hashed_string".to_owned(),
            iat: 0,
            exp: 100,
        };
        assert_eq!(claims, expected_claims);
    }

    #[test]
    fn transaction_serialize_correctly() {

    }

    #[test]
    fn transaction_deserialize_correctly() {

    }

    #[test]
    fn block_serialize_correctly() {

    }

    #[test]
    fn block_deserialize_correctly() {

    }

    #[test]
    fn block_deserialize_when_vec_emptpy() {

    }

    #[test]
    fn naked_block_serialize_correctly() {

    }

    #[test]
    fn naked_block_deserialize_correctly() {

    }

    #[test]
    fn naked_block_deserialize_when_vec_emptpy() {

    }

    #[test]
    fn user_serialize_correctly() {

    }

    #[test]
    fn user_deserialize_correctly() {

    }

    #[test]
    fn metu_id_serialize_correctly() {

    }

    #[test]
    fn metu_id_deserialize_correctly() {

    }

    #[test]
    fn auth_request_serialize_correctly() {

    }

    #[test]
    fn auth_request_deserialize_correctly() {

    }














}