#![cfg(test)]

use crate::{bd_system::BdSystem, doctor::FakeDoctor, host::Hosts, media::FakeOutputDevice};

#[tokio::test]
async fn test_system_with_default_data() {
    let system = BdSystem::new(
        FakeDoctor::new(true),
        Hosts::default(),
        FakeOutputDevice::default(),
        10,
    );

    assert!(system.run().await);
}

#[tokio::test]
async fn test_system_with_deserialize_data() {
    let raw_data = r#"
        { "hosts": [{ "name": "Xcapit", "url": "https://xcapit.com" }] }
    "#;
    let system = BdSystem::new(
        FakeDoctor::new(true),
        Hosts::from(raw_data).unwrap(),
        FakeOutputDevice::default(),
        10,
    );

    assert!(system.run().await);
}
