mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 16:03:31 +00:00
added uuid test with args
This commit is contained in:
51
src/tests.rs
51
src/tests.rs
@@ -1,49 +1,30 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
mod uuid_tests {
|
||||
use uuid::Uuid;
|
||||
use crate::init;
|
||||
|
||||
#[test]
|
||||
fn uuid_output_is_string() {
|
||||
let extension = init().testing();
|
||||
let (output, _) = extension.call("uuid", None);
|
||||
assert_eq!(output, output.to_string())
|
||||
}
|
||||
use uuid::Uuid;
|
||||
use std::vec;
|
||||
|
||||
#[test]
|
||||
fn uuid_output_is_uuid4_identifier() {
|
||||
let extension = init().testing();
|
||||
let (output, _) = extension.call("uuid", None);
|
||||
|
||||
let parsed_uuid = Uuid::parse_str(&output);
|
||||
assert!(parsed_uuid.is_ok());
|
||||
assert_eq!(parsed_uuid.unwrap().get_version(), Some(uuid::Version::Random))
|
||||
let validation = Uuid::parse_str(&output);
|
||||
|
||||
assert!(validation.is_ok())
|
||||
}
|
||||
|
||||
|
||||
#[test]
|
||||
fn uuid_output_throws_if_passed_args() {
|
||||
let extension = init().testing();
|
||||
let args: Vec<String> = vec![1.to_string(),2.to_string()];
|
||||
let (output, _) = extension.call("uuid", Some(args));
|
||||
|
||||
assert_eq!(output,"")
|
||||
}
|
||||
}
|
||||
|
||||
mod markers_tests {
|
||||
use crate::init;
|
||||
|
||||
#[test]
|
||||
fn get_is_defined() {
|
||||
let extension = init().testing();
|
||||
let (output, _) = extension.call("markers:get", Some(vec!["".to_string()]));
|
||||
assert_eq!(output, "ERROR: Not implemented yet, ")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn post_is_defined() {
|
||||
let extension = init().testing();
|
||||
let (output, _) = extension.call("markers:post", Some(vec!["".to_string()]));
|
||||
assert_eq!(output, "ERROR: Not implemented yet, ")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn delete_is_defined() {
|
||||
let extension = init().testing();
|
||||
let (output, _) = extension.call("markers:delete", Some(vec!["".to_string()]));
|
||||
assert_eq!(output, "ERROR: Not implemented yet, ")
|
||||
}
|
||||
}
|
||||
mod markers_tests {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user