Skip to content

Commit

Permalink
Prepared for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
williamwoldum committed Nov 23, 2023
1 parent 15e485f commit b843518
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/api/ecdar_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,13 @@ impl EcdarBackend for ConcreteEcdarApi {
}
}

#[cfg(test)]
#[path = "../tests/api/access_logic.rs"]
mod access_logic;
#[cfg(test)]
#[path = "../tests/api/ecdar_api.rs"]
mod tests;

#[cfg(test)]
#[path = "../tests/api/query_logic.rs"]
mod query_logic;
40 changes: 40 additions & 0 deletions src/tests/api/access_logic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#[cfg(test)]
mod access_logic {
use crate::tests::api::helpers::get_mock_services;

#[tokio::test]
async fn create_access_foreign_key_constraint_err_returns_err() {
let mut mock_services = get_mock_services();
assert!(true);
}

#[tokio::test]
async fn create_access_returns_ok() {
let mut mock_services = get_mock_services();
assert!(true);
}

#[tokio::test]
async fn update_access_foreign_key_constraint_err_returns_err() {
let mut mock_services = get_mock_services();
assert!(true);
}

#[tokio::test]
async fn update_access_returns_ok() {
let mut mock_services = get_mock_services();
assert!(true);
}

#[tokio::test]
async fn delete_nonexistent_access_returns_err() {
let mut mock_services = get_mock_services();
assert!(true);
}

#[tokio::test]
async fn delete_existent_access_returns_ok() {
let mut mock_services = get_mock_services();
assert!(true);
}
}
40 changes: 40 additions & 0 deletions src/tests/api/query_logic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#[cfg(test)]
mod query_logic {
use crate::tests::api::helpers::get_mock_services;

#[tokio::test]
async fn create_query_foreign_key_constraint_err_returns_err() {
let mut mock_services = get_mock_services();
assert!(true);
}

#[tokio::test]
async fn create_query_returns_ok() {
let mut mock_services = get_mock_services();
assert!(true);
}

#[tokio::test]
async fn update_query_foreign_key_constraint_err_returns_err() {
let mut mock_services = get_mock_services();
assert!(true);
}

#[tokio::test]
async fn update_query_returns_ok() {
let mut mock_services = get_mock_services();
assert!(true);
}

#[tokio::test]
async fn delete_nonexistent_query_returns_err() {
let mut mock_services = get_mock_services();
assert!(true);
}

#[tokio::test]
async fn delete_existent_query_returns_ok() {
let mut mock_services = get_mock_services();
assert!(true);
}
}

0 comments on commit b843518

Please sign in to comment.