mod prepare_tests;
#[tokio::test]
async fn test_query_for_value_array() -> Result<(), Box<dyn std::error::Error>> {
let mut client = prepare_tests::prepare_test().await?;
let email_values = client.query_for_value_array("#person.email").await?;
let emails = email_values
.iter()
.map(|v| v.as_str().unwrap())
.collect::<Vec<&str>>();
let expected_emails = [
"Estrella.Hane@hotmail.com",
"Russell.Hickle63@hotmail.com",
"Lottie.Reichel95@yahoo.com",
"Gerald.Paucek@gmail.com",
"Devon_Swaniawski59@yahoo.com",
"Laurine33@yahoo.com",
"Jakob72@gmail.com",
"Claudia70@gmail.com",
"Melba32@yahoo.com",
"Vincent55@hotmail.com",
];
expected_emails
.iter()
.for_each(|email| assert!(emails.contains(email)));
let result = client.query_for_value_array("asdf").await;
assert!(result.is_err());
Ok(())
}