mod test_client;
use self::test_client::TestClient;
use crate::APIInterface;

pub mod api_interface {
    use crate::model::Conversation;

    use super::*;

    #[tokio::test]
    async fn test_version() {
        let mut client = TestClient::new();
        let version = client.get_version().await.unwrap();
        assert_eq!(version, client.version);
    }

    #[tokio::test]
    async fn test_conversations() {
        let mut client = TestClient::new();

        let test_convo = Conversation::builder()
            .display_name("Test Conversation")
            .build();

        client.conversations.push(test_convo.clone());

        let conversations = client.get_conversations().await.unwrap();
        assert_eq!(conversations.len(), 1);
        assert_eq!(conversations[0].display_name, test_convo.display_name);
    }
}
