Section I - module
#[test]
fn test_get_topic_service_path() {
assert_eq!(get_service_path_topic(), format!("/tdg/{}/{{topic}}", VER));
}#[cfg(test)]
mod tests {
use super::*;
#[allow(unused_imports)]
use actix_web::{test};
#[test]
fn test_get_service_root() {
assert_eq!(get_service_root(), format!("/tdg/{}", VER));
}
#[test]
fn test_get_service_path() {
assert_eq!(get_service_path(), format!("/tdg/{}/", VER));
}
#[test]
fn test_get_topic_service_path() {
assert_eq!(get_service_path_topic(), format!("/tdg/{}/{{topic}}", VER));
}
#[test]
fn ok_response() {
let req = test::TestRequest::with_header("content-type", "text/plain")
.to_http_request();
let resp = index(req);
assert_eq!(resp.status(), StatusCode::OK);
}
}Last updated