Esempio n. 1
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.Error.WriteLine("Input filename required.");
                return;
            }

            var path = GetPathFromArgs(args);

            var gradeSorter = new GradeSorter();

            if (gradeSorter.LoadData(path))
            {
                gradeSorter.SortData();
                gradeSorter.SaveData(Helper.GenerateOutputPath(path));
            }
        }
Esempio n. 2
0
        public void TestSaveData()
        {
            var gradeSorter = new GradeSorter();

            TestUtilities.GenerateInputFile(DataFactory.GetDataSet(10, false));

            Assert.IsTrue(gradeSorter.LoadData(TestUtilities.GetInputFilePath()), "LoadData failed.");

            gradeSorter.SaveData(TestUtilities.GetOutputFilePath());

            Assert.IsTrue(System.IO.File.Exists(TestUtilities.GetOutputFilePath()));

            TestUtilities.DeleteFiles();
        }