示例#1
0
    public void PrintDataToLocation()
    {
        SchoolParser parser = new SchoolParser(SchoolDataJson.text);

        parser.ParseJson();
        SaveFile.SaveSchoolDataToUsersLocation(parser.SchoolData);
    }
示例#2
0
        public void SchoolDataIsNotNull()
        {
            SchoolParser jsonParser = new SchoolParser(schoolJsonData);

            jsonParser.ParseJson();

            Assert.IsNotNull(jsonParser.SchoolData);
        }
示例#3
0
        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);
        }
示例#4
0
    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();
    }
示例#5
0
    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);
    }