Moved support tests to client.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
@@ -59,6 +59,7 @@ fn can_field_types_be_varied() {
|
|||||||
fn can_record_be_added_to_document() {
|
fn can_record_be_added_to_document() {
|
||||||
let count = 5;
|
let count = 5;
|
||||||
let mut mtt = MoreThanText::new();
|
let mut mtt = MoreThanText::new();
|
||||||
|
let client = mtt.client();
|
||||||
let mut fields: Vec<FieldType> = Vec::new();
|
let mut fields: Vec<FieldType> = Vec::new();
|
||||||
let mut input: Vec<String> = Vec::new();
|
let mut input: Vec<String> = Vec::new();
|
||||||
for i in 0..count {
|
for i in 0..count {
|
||||||
@@ -66,10 +67,10 @@ fn can_record_be_added_to_document() {
|
|||||||
input.push(i.to_string());
|
input.push(i.to_string());
|
||||||
}
|
}
|
||||||
let test_doc = TestDocument::new(fields);
|
let test_doc = TestDocument::new(fields);
|
||||||
mtt.create_document(test_doc.get_docdef());
|
client.create_document(test_doc.get_docdef());
|
||||||
test_doc.populate(mtt.clone(), input);
|
test_doc.populate(mtt.clone(), input);
|
||||||
let query = Query::new(test_doc.get_doc_name());
|
let query = Query::new(test_doc.get_doc_name());
|
||||||
let results = mtt.records(query).unwrap();
|
let results = client.records(query).unwrap();
|
||||||
assert_eq!(results.len(), 1);
|
assert_eq!(results.len(), 1);
|
||||||
for rec in results.iter() {
|
for rec in results.iter() {
|
||||||
for i in 0..count {
|
for i in 0..count {
|
||||||
@@ -83,8 +84,9 @@ fn can_record_be_added_to_document() {
|
|||||||
fn can_document_be_populated_with_multiple_records() {
|
fn can_document_be_populated_with_multiple_records() {
|
||||||
let count = 5;
|
let count = 5;
|
||||||
let mut mtt = MoreThanText::new();
|
let mut mtt = MoreThanText::new();
|
||||||
|
let client = mtt.client();
|
||||||
let test_doc = TestDocument::new(vec![FieldType::Integer]);
|
let test_doc = TestDocument::new(vec![FieldType::Integer]);
|
||||||
mtt.create_document(test_doc.get_docdef());
|
client.create_document(test_doc.get_docdef());
|
||||||
let mut data: Vec<Vec<i128>> = Vec::new();
|
let mut data: Vec<Vec<i128>> = Vec::new();
|
||||||
for i in 0..count {
|
for i in 0..count {
|
||||||
let item: i128 = i.try_into().unwrap();
|
let item: i128 = i.try_into().unwrap();
|
||||||
@@ -93,6 +95,6 @@ fn can_document_be_populated_with_multiple_records() {
|
|||||||
}
|
}
|
||||||
test_doc.populate_multiple(mtt.clone(), data);
|
test_doc.populate_multiple(mtt.clone(), data);
|
||||||
let query = Query::new(test_doc.get_doc_name());
|
let query = Query::new(test_doc.get_doc_name());
|
||||||
let results = mtt.records(query).unwrap();
|
let results = client.records(query).unwrap();
|
||||||
assert_eq!(results.len(), count);
|
assert_eq!(results.len(), count);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user