/// <summary>
        /// The main entry point for the application
        /// </summary>
        static void Main(string[] args)
        {
            bool           is_en_culture = Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName == "en";
            FileCollection fc            = new FileCollection(new ConsoleLog());

            Console.WriteLine(is_en_culture? "Application launch" : "Запуск приложения");
            try
            {
                fc.RunProcess(fc.GetDefaultDirectory(true));
            }
            catch (Exception e)
            {
                Console.WriteLine(is_en_culture ? "Error in Process: {0}" : "Ошибка при выполнении: {0}", e.Message);
            }
            Console.WriteLine(is_en_culture ? "Press the key to exit..." : "Нажмите клавишу для завершения...");
            Console.Read();
        }
Beispiel #2
0
        public void TestMethod1()
        {
            using (var sw = new StringWriter())
            {
                string path = Environment.CurrentDirectory + @"\TestDir";
                Directory.CreateDirectory(path);

                string text = "";
                for (int i = 0; i < Expected - 2; i++)
                {
                    text += '1';
                }

                string txt_file    = path + @"\1.txt";
                string result_file = path + @"\Result.xml";
                using (StreamWriter fw = new StreamWriter(txt_file, false, System.Text.Encoding.Default))
                {
                    fw.WriteLine(text);
                }

                FileCollection fc = new FileCollection(new ConsoleLog());
                fc.RunProcess(path);

                XmlDocument doc = new XmlDocument();
                doc.Load(result_file);

                int result = 0;
                foreach (XmlNode node in doc.DocumentElement)
                {
                    string name = node.Attributes[0].Value;
                    result = int.Parse(node["ByteCount"].InnerText);
                }
                File.Delete(txt_file);
                File.Delete(result_file);
                Directory.Delete(path);

                Assert.AreEqual(Expected, result);
            }
        }
Beispiel #3
0
 private void ProcStart(object path)
 {
     fc.RunProcess((string)path);
 }