3 protected static const string JSON_FILE_PATH =
"scripts/data/credits.json";
5 static void CreateTestJson()
7 string nameDepartment =
"Department";
8 string nameSection =
"Section";
9 string nameLine =
"Line";
14 for (
int index_dep = 0; index_dep < 3; ++index_dep)
18 department.DepartmentName = (nameDepartment +
" "+ index_dep);
20 for (
int index_sec = 0; index_sec < 4; ++index_sec)
24 section.SectionName = (nameSection +
" "+ index_sec);
26 int linesCount =
Math.RandomInt(3, 10);
27 for (
int i = 0; i < linesCount; ++i)
29 section.SectionLines.Insert(nameLine +
" "+ i);
32 department.Sections.Insert(section);
35 data.Departments.Insert(department);
39 if (!JsonFileLoader<ref JsonDataCredits>.SaveFile(JSON_FILE_PATH, data, errorMessage))
48 if (!JsonFileLoader<ref JsonDataCredits>.LoadFile(JSON_FILE_PATH, data, errorMessage))