Ejemplo n.º 1
0
        public void TestCase()
        {
            ReadFile rf             = new ReadFile();
            string   pathForReading = "test.txt";
            string   pathForWriting = "names-sorted.txt";

            rf.GetFile(pathForReading, pathForWriting);
            if (File.Exists(pathForWriting))
            {
                string[] names = { "BAKER, THEODORE", "KENT, MADISON", "SMITH, ANDREW", "SMITH, FREDRICK" };
                int      i     = 0;
                //Read the file
                string[] lines = System.IO.File.ReadAllLines(pathForWriting);
                foreach (string line in lines)
                {
                    Assert.AreEqual(names[i], line);
                    i++;
                }
            }
            else
            {
                Assert.Fail("Failed to create file!!");
            }
        }