summaryrefslogtreecommitdiff
path: root/src/lib.rs
blob: b293ab7d27f6883ad6c02de7b362d3fa367d7beb (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
pub mod betterttv;
pub mod emotes;
pub mod frankerfacez;

#[cfg(test)]
mod tests {
    use crate::{
        betterttv::BetterTTVAPIClient, emotes::RetrieveEmoteAPI,
        frankerfacez::FrankerFaceZAPIClient,
    };

    #[tokio::test]
    async fn get_betterttv_channel_emotes() {
        let bttv = BetterTTVAPIClient::new();
        let emotes = bttv.get_channel_emotes("555579413").await;

        assert_eq!(emotes.is_ok(), true);

        let emotes = emotes.unwrap();

        assert_eq!(emotes.len(), 1);
    }

    #[tokio::test]
    async fn get_betterttv_global_emotes() {
        let bttv = BetterTTVAPIClient::new();
        let emotes = bttv.get_global_emotes().await;

        assert_eq!(emotes.is_ok(), true);

        let emotes = emotes.unwrap();

        assert_eq!(emotes.len() >= 1, true);
    }

    #[tokio::test]
    async fn get_frankerfacez_channel_emotes() {
        let ffz = FrankerFaceZAPIClient::new();
        let emotes = ffz.get_channel_emotes("555579413").await;

        assert_eq!(emotes.is_ok(), true);

        let emotes = emotes.unwrap();

        assert_eq!(emotes.len() >= 1, true);
    }

    #[tokio::test]
    async fn get_frankerfacez_global_emotes() {
        let ffz = FrankerFaceZAPIClient::new();
        let emotes = ffz.get_global_emotes().await;

        assert_eq!(emotes.is_ok(), true);

        let emotes = emotes.unwrap();

        assert_eq!(emotes.len() >= 1, true);
    }
}