Ejemplo n.º 1
0
        public void TestRead()
        {
            var    cwd          = new FileInfo(Assembly.GetExecutingAssembly().Location).DirectoryName;
            string tempFilename = Path.Combine(cwd, Path.GetRandomFileName());

            string testText = "hello world!";

            File.WriteAllText(tempFilename, testText);

            var filePath = new MonoDevelop.Core.FilePath(tempFilename);
            var tf       = new Text.TextFile();

            tf.Read(filePath, "UTF8");

            try {
                Assert.AreEqual(tf.Text, testText);
            } finally {
                File.Delete(tempFilename);
            }
        }