Initial commit
This commit is contained in:
8
kordophone/Cargo.toml
Normal file
8
kordophone/Cargo.toml
Normal file
@@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "kordophone"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
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