mod commons;
use tokio_fastcgi::Requests;
use crate::commons::*;
pub async fn run_test<T: TestCase>() {
let mut requests = Requests::new(T::get_input(), T::get_output(), 5, 10);
while let Some(request) = requests.next().await.expect("Request could not be constructed.") {
request.process(T::processor).await.expect("Error while processing.");
}
}
#[tokio::test]
async fn params_in_out() {
run_test::<TestParamsInOut>().await;
}
#[tokio::test]
async fn role_authorizer() {
run_test::<TestRoleAuthorizer>().await;
}
#[tokio::test]
async fn role_filter() {
run_test::<TestRoleFilter>().await;
}
#[tokio::test]
async fn abort_request() {
run_test::<TestAbortRequest>().await;
}
#[tokio::test]
async fn abort_continue() {
run_test::<TestAbortContinue>().await;
}
#[tokio::test]
async fn test_unknown_role_return() {
run_test::<TestUnknownRoleReturn>().await;
}
#[tokio::test]
#[should_panic(expected = "InvalidRoleNumber")]
async fn test_unknown_role_request() {
run_test::<TestUnknownRoleRequest>().await;
}
#[tokio::test]
async fn unkown_request_type() {
run_test::<TestUnknownRequestType>().await;
}
#[tokio::test]
async fn get_values() {
run_test::<TestGetValues>().await;
}
#[tokio::test]
async fn keep_connection() {
run_test::<TestKeepConnection>().await;
}