Esempio n. 1
0
    void Start()
    {
        path = "XMLScript";
        TextContainer ic = TextContainer.Load(path);

        textField = GetComponent <Text>();
        foreach (Line line in ic.lines)
        {
            strings.Add(line.name);
        }
    }
        public void LoadFromFilename_SampleContainer_ReturnsCorrectValue()
        {
            string dir      = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "SeriousGameToolbox");
            string filename = Path.Combine(dir, "sample_text_container.xml");

            Directory.CreateDirectory(dir);

            using (StreamWriter writer = new StreamWriter(filename))
            {
                writer.Write(Properties.Resources.text_container_1);
            }

            var result = TextContainer.Load(filename);

            CheckAgainstSampleFile(result);
        }
 public void LoadFromFilename_InvalidFilename_ThrowsFileNotFoundException()
 {
     TextContainer.Load("invalid filename");
 }
 public void LoadFromFilename_NullFilename_ThrowsArgumentNullException()
 {
     TextContainer.Load(Deliberate.Null as string);
 }