public void PrintDataToLocation() { SchoolParser parser = new SchoolParser(SchoolDataJson.text); parser.ParseJson(); SaveFile.SaveSchoolDataToUsersLocation(parser.SchoolData); }
public void SchoolDataIsNotNull() { SchoolParser jsonParser = new SchoolParser(schoolJsonData); jsonParser.ParseJson(); Assert.IsNotNull(jsonParser.SchoolData); }
public void ContainsRightAmountOfSchoolData() { SchoolParser jsonParser = new SchoolParser(schoolJsonData); jsonParser.ParseJson(); Assert.AreEqual(5, jsonParser.SchoolData.classes.Count); Assert.AreEqual(20, jsonParser.SchoolData.userdata.Count); Assert.AreEqual(4, jsonParser.SchoolData.subjects.Count); }
public void SwitchParser() { ClearUIData(); CurrentParser = InitializeParser(SelectNextParser(CurrentParseType)); CurrentParser.ParseJson(); StopAllCoroutines(); StartCoroutine(ProcessSchoolDataToUIWithInterval(CurrentParser.SchoolData, ProcessingTime)); // Update the name of the current parser on the UI CurrentParserText.text = "Parser type: " + CurrentParseType.ToString(); }
private SchoolParser InitializeParser(ParseType parseType) { SchoolParser parser; switch (parseType) { default: parser = new SchoolParser(SchoolDataJson.text); break; case ParseType.Student: parser = new StudentParser(SchoolDataJson.text); break; case ParseType.Teacher: parser = new TeacherParser(SchoolDataJson.text); break; } return(parser); }