Ejemplo n.º 1
0
        /// <summary>
        /// Entry point
        /// </summary>
        public static void Main(String[] args)
        {
            Application app = null;
            try
            {
                Console.Write("Setty 1.0");
                app = new Application(args);
                app.Launch();
            }
            catch (SettingsFolderNotFound e)
            {
                Console.WriteLine();
                Console.WriteLine("ERROR: " + e.Message);
            }
            catch (Exception e)
            {
                Console.WriteLine();
                Console.WriteLine("ERROR: " + e.Message);
            }

            if (app != null && !app.Silent)
            {
                Console.WriteLine();
                Console.WriteLine("Press any key to exit...");
                Console.ReadKey();
            }
        }
Ejemplo n.º 2
0
        public void ContextSpecifiedWithoutQuotes()
        {
            const string context = "c:\\some\\path";

            var args = new List<String> {
                    String.Format("/context:{0}", context)
                };

            var app = new Application(args.ToArray());

            Assert.AreEqual(app.ContextFolder, context);
            Assert.AreEqual(app.SettingsFolder, String.Empty);
        }
Ejemplo n.º 3
0
        public void SettingsSpecifiedInAnotherOrder()
        {
            const string context = "c:\\some\\path";
            const string settings = "c:\\settings\\path";

            var args = new List<String> {
                String.Format("/settings:\"{0}\"", settings),
                String.Format("/context:\"{0}\"", context),
            };

            var app = new Application(args.ToArray());

            Assert.AreEqual(app.ContextFolder, context);
            Assert.AreEqual(app.SettingsFolder, settings);
        }
Ejemplo n.º 4
0
        public void Simple()
        {
            var args = new List<String> {
            };

            var app = new Application(args.ToArray());

            Assert.AreEqual(app.ContextFolder, Environment.CurrentDirectory);
            Assert.AreEqual(app.SettingsFolder, String.Empty);
        }