mirror of
https://github.com/agdamsbo/REDCapCAST.git
synced 2026-06-21 14:09:08 +02:00
Writing unit tests for basic examples of data export for R.
This commit is contained in:
parent
ef4819e1fc
commit
4841e1170e
9 changed files with 1932 additions and 6 deletions
362
R/tests/testthat/data/ExampleProject_metadata.json
Normal file
362
R/tests/testthat/data/ExampleProject_metadata.json
Normal file
|
|
@ -0,0 +1,362 @@
|
|||
[
|
||||
{
|
||||
"field_name": "row",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "text",
|
||||
"field_label": "Name",
|
||||
"select_choices_or_calculations": "",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "mpg",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "text",
|
||||
"field_label": "Miles/(US) gallon",
|
||||
"select_choices_or_calculations": "",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "number",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "cyl",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "radio",
|
||||
"field_label": "Number of cylinders",
|
||||
"select_choices_or_calculations": "3, 3 | 4, 4 | 5, 5 | 6, 6 | 7, 7 | 8, 8",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "disp",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "text",
|
||||
"field_label": "Displacement",
|
||||
"select_choices_or_calculations": "",
|
||||
"field_note": "(cu.in.)",
|
||||
"text_validation_type_or_show_slider_number": "number",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "hp",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "text",
|
||||
"field_label": "Gross horsepower",
|
||||
"select_choices_or_calculations": "",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "number",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "drat",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "text",
|
||||
"field_label": "Rear axle ratio",
|
||||
"select_choices_or_calculations": "",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "number",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "wt",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "text",
|
||||
"field_label": "Weight",
|
||||
"select_choices_or_calculations": "",
|
||||
"field_note": "(1000 lbs)",
|
||||
"text_validation_type_or_show_slider_number": "number",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "qsec",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "text",
|
||||
"field_label": "1/4 mile time",
|
||||
"select_choices_or_calculations": "",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "number",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "vs",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "yesno",
|
||||
"field_label": "V engine?",
|
||||
"select_choices_or_calculations": "",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "am",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "dropdown",
|
||||
"field_label": "Transmission",
|
||||
"select_choices_or_calculations": "0, Automatic | 1, Manual",
|
||||
"field_note": " (0 = automatic, 1 = manual)",
|
||||
"text_validation_type_or_show_slider_number": "",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "gear",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "radio",
|
||||
"field_label": "Number of forward gears",
|
||||
"select_choices_or_calculations": "3, 3 | 4, 4 | 5, 5",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "carb",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "radio",
|
||||
"field_label": "Number of carburetors",
|
||||
"select_choices_or_calculations": "1, 1 | 2, 2 | 3, 3 | 4, 4 | 5, 5 | 6, 6 | 7, 7 | 8, 8",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "color_available",
|
||||
"form_name": "motor_trend_cars",
|
||||
"section_header": "",
|
||||
"field_type": "checkbox",
|
||||
"field_label": "Colors Available",
|
||||
"select_choices_or_calculations": "red, Red | green, Green | blue, Blue | black, Black",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "letter_group",
|
||||
"form_name": "grouping",
|
||||
"section_header": "",
|
||||
"field_type": "checkbox",
|
||||
"field_label": "Which group?",
|
||||
"select_choices_or_calculations": "a, A | b, B | c, C",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "choice",
|
||||
"form_name": "grouping",
|
||||
"section_header": "",
|
||||
"field_type": "radio",
|
||||
"field_label": "Choose one",
|
||||
"select_choices_or_calculations": "choice1, Choice 1 | choice2, Choice 2",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "price",
|
||||
"form_name": "sale",
|
||||
"section_header": "",
|
||||
"field_type": "text",
|
||||
"field_label": "Sale price",
|
||||
"select_choices_or_calculations": "",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "number_2dp",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "color",
|
||||
"form_name": "sale",
|
||||
"section_header": "",
|
||||
"field_type": "dropdown",
|
||||
"field_label": "Color",
|
||||
"select_choices_or_calculations": "1, red | 2, green | 3, blue | 4, black",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
},
|
||||
{
|
||||
"field_name": "customer",
|
||||
"form_name": "sale",
|
||||
"section_header": "",
|
||||
"field_type": "text",
|
||||
"field_label": "Customer Name",
|
||||
"select_choices_or_calculations": "",
|
||||
"field_note": "",
|
||||
"text_validation_type_or_show_slider_number": "",
|
||||
"text_validation_min": "",
|
||||
"text_validation_max": "",
|
||||
"identifier": "",
|
||||
"branching_logic": "",
|
||||
"required_field": "",
|
||||
"custom_alignment": "RH",
|
||||
"question_number": "",
|
||||
"matrix_group_name": "",
|
||||
"matrix_ranking": "",
|
||||
"field_annotation": ""
|
||||
}
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue