Initial commit
This commit is contained in:
12
kordophone/src/api/mod.rs
Normal file
12
kordophone/src/api/mod.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
|
||||
pub trait APIInterface {
|
||||
fn version(&self) -> String;
|
||||
}
|
||||
|
||||
pub struct TestClient {}
|
||||
|
||||
impl APIInterface for TestClient {
|
||||
fn version(&self) -> String {
|
||||
return "KordophoneTest-1.0".to_string()
|
||||
}
|
||||
}
|
||||
16
kordophone/src/lib.rs
Normal file
16
kordophone/src/lib.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
mod api;
|
||||
|
||||
pub use self::api::TestClient;
|
||||
pub use self::api::APIInterface;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_version() {
|
||||
let client = TestClient{};
|
||||
let version = client.version();
|
||||
assert_eq!(version, "KordophoneTest-1.0");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user