Refactor(Test): Move Tests To Seperate Folder

This commit is contained in:
Tochukwu Nkemdilim
2018-07-19 16:25:35 +01:00
parent 65c641670d
commit 3dd0aae87c
2 changed files with 20 additions and 24 deletions
-24
View File
@@ -10,27 +10,3 @@ pub mod prelude {
}
pub use platforms::*;
#[cfg(test)]
mod tests {
use super::prelude::*;
use super::*;
#[test]
fn connect_to_wifi_failed() {
let config = Some(Config {
interface: Some("wlo1"),
});
let mut wifi = WiFi::new(config);
assert_eq!(wifi.connect("ssid", "password").unwrap(), false);
}
#[test]
fn create_hotspot() {
let hotspot_created = WiFi::create_hotspot("hello", "hi").unwrap();
assert_eq!(hotspot_created, true);
}
}
+20
View File
@@ -0,0 +1,20 @@
extern crate wifi_rs;
use self::wifi_rs::{prelude::*, Config, WiFi};
#[test]
fn connect_to_wifi_failed() {
let config = Some(Config {
interface: Some("wlo1"),
});
let mut wifi = WiFi::new(config);
assert_eq!(wifi.connect("ssid", "password").unwrap(), false);
}
#[test]
fn create_hotspot() {
let hotspot_created = WiFi::create_hotspot("hello", "hi").unwrap();
assert_eq!(hotspot_created, true);
}