示例#1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Gherkin parser import tool:");
            Console.WriteLine("  + adds signing for the assembly");
            Console.WriteLine("  + generates Language.xml from the parser");
            Console.WriteLine();

            Consolery.Run(typeof(Program), args);
            return;
        }
示例#2
0
        private static void Main(string[] args)
        {
            Trace.Listeners.Add(new ConsoleTraceListener());

            Log.WriteLine($"Altairis AutoACME Manager version {Assembly.GetExecutingAssembly().GetName().Version}");
            Log.WriteLine("Copyright © Michal A. Valášek - Altairis and contributors, 2017-2019");
            Log.WriteLine("www.autoacme.net | www.rider.cz | www.altairis.cz");
            Log.WriteLine();
            Consolery.Run();
        }
示例#3
0
        static void Main(string[] args)
        {
            Trace.Listeners.Add(new ConsoleTraceListener());
            Trace.IndentSize = 2;

            Trace.WriteLine($"Altairis AutoACME Manager version {System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}");
            Trace.WriteLine("Copyright (c) Michal A. Valasek - Altairis, 2017");
            Trace.WriteLine("www.autoacme.net | www.rider.cz | www.altairis.cz");
            Trace.WriteLine(string.Empty);
            Consolery.Run();
        }
示例#4
0
文件: Program.cs 项目: rokx/AutoACME
        static void Main(string[] args)
        {
            Trace.Listeners.Add(new ConsoleTraceListener());

            Log.WriteLine($"Altairis AutoACME IIS Synchronization Tool version {System.Reflection.Assembly.GetExecutingAssembly().GetName().Version}");
            Log.WriteLine("Copyright (c) Michal A. Valasek - Altairis, 2017");
            Log.WriteLine("www.autoacme.net | www.rider.cz | www.altairis.cz");
            Log.WriteLine();

            Consolery.Run();
        }
示例#5
0
        static void Main(string[] args)
        {
            Console.WriteLine("Altairis DB>doc version {0:4}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
            Console.WriteLine("Copyright (c) Altairis, 2011 | www.altairis.cz | SqlDbDoc.codeplex.com");
            Console.WriteLine();

            // Add console trace listener
            Trace.Listeners.Add(new ConsoleTraceListener());

            // Run actions
            Consolery.Run();
        }
示例#6
0
        public void RunConsoleProgramWithoutOptionalParameters()
        {
            Consolery.Run(typeof(ManyParametersProgram),
                          new[] { "string", "1", "true" });

            Assert.That(_verifier.sParameter, Is.EqualTo("string"));
            Assert.That(_verifier.iParameter, Is.EqualTo(1));
            Assert.That(_verifier.bParameter, Is.EqualTo(true));
            Assert.That(_verifier.osParameter, Is.EqualTo("0"));
            Assert.That(_verifier.oiParameter, Is.EqualTo(0));
            Assert.That(_verifier.obParameter, Is.EqualTo(false));
        }
示例#7
0
        public void NegativeBooleanParameter()
        {
            Consolery.Run(typeof(ManyParametersProgram),
                          new[] { "string", "1", "true", "/-ob" });

            Assert.That(_verifier.sParameter, Is.EqualTo("string"));
            Assert.That(_verifier.iParameter, Is.EqualTo(1));
            Assert.That(_verifier.bParameter, Is.EqualTo(true));
            Assert.That(_verifier.osParameter, Is.EqualTo("0"));
            Assert.That(_verifier.oiParameter, Is.EqualTo(0));
            Assert.That(_verifier.obParameter, Is.EqualTo(false));
        }
示例#8
0
        public void ManyParameters()
        {
            Consolery.Run(typeof(ManyParametersProgram),
                          new[] { "string", "1", "true", "/os:string", "/oi:1", "/ob" });

            Assert.That(_verifier.sParameter, Is.EqualTo("string"));
            Assert.That(_verifier.iParameter, Is.EqualTo(1));
            Assert.That(_verifier.bParameter, Is.EqualTo(true));
            Assert.That(_verifier.osParameter, Is.EqualTo("string"));
            Assert.That(_verifier.oiParameter, Is.EqualTo(1));
            Assert.That(_verifier.obParameter, Is.EqualTo(true));
        }
示例#9
0
            public void ShouldShowDefaultValueForOptionalParameter()
            {
                Consolery.Run(typeof(OneActionProgramWithOptionalParameters), new[] { "help", "Test" }, _messenger);
                var console = ConsoleOutput();

                Assert.That(
                    console.Contains(
                        @"usage: oneactionprogramwithoptionalparameters [/parameter1:value] [/param2:number]
    [/parameter1:value]  param1 desc
        default value: 'value1'
    [/param2:number]     desc2
        default value: 42"));
            }
示例#10
0
        static void Main(string[] args)
        {
            Log.Logger = new LoggerConfiguration()
                         .WriteTo.Console()
                         .WriteTo.File("log-.txt", rollingInterval: RollingInterval.Day)
                         .CreateLogger();

            _sorter = new MusicSorter();

            Log.Information("Music Sorter v0.1a");
            Log.Information("--------------------------------------");
            Consolery.Run(typeof(Program), args);
        }
示例#11
0
            public void NotAllRequiredParametersAreSet()
            {
                Consolery.Run(typeof(ManyParametersProgram),
                              new[] { "test" }, _messenger);
                var console = ConsoleOutput();

                Assert.That(console.Contains(
                                @"usage: manyparametersprogram sParameter iParameter bParameter [/os:value] [/oi:number] [/ob]
    [/os:value]
        default value: '0'
    [/oi:number]
        default value: 0
    [/ob]
        default value: False
Error: Not all required parameters are set"));
            }
示例#12
0
        public void WhenTargetMethodThrowsAnException()
        {
            Exception exception = null;

            try
            {
                Consolery.Run(typeof(ExceptionalProgram), new[] { "/-parameter" });
            }
            catch (Exception e)
            {
                exception = e;
            }

            Assert.That(exception, Is.Not.Null);
            Assert.That(exception.GetType(), Is.EqualTo(typeof(SpecificException)));
        }
示例#13
0
        static void Main(string[] args)
        {
            Console.WriteLine("Altairis DB>doc version {0:4}", System.Reflection.Assembly.GetExecutingAssembly().GetName().Version);
            Console.WriteLine("Copyright (c) Altairis, 2011 | www.altairis.cz | SqlDbDoc.codeplex.com");
            Console.WriteLine("Modifications by HAVIT, 2015 | www.havit.eu | https://github.com/hakenr/SqlDbDoc");
            Console.WriteLine("Modifications by MissAmberInSeattle, 2018");
            Console.WriteLine();

            // Add console trace listener
            Trace.Listeners.Add(new ConsoleTraceListener());

            try
            {
                // Run actions
                Consolery.Run();
                Console.WriteLine("Complete. Press enter to finish.");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex);
            }
        }
示例#14
0
 private static void Main(string[] args)
 {
     Consolery.Run(typeof(Program), args);
     return;
 }
示例#15
0
 private static void Main(string[] args) => Consolery.Run();
示例#16
0
 public void WithoutMethods()
 {
     Consolery.Run(typeof(WithoutMethodsProgram), new[] { "string" }, _messenger);
 }
示例#17
0
        public void ShouldCorrectlyConvertToDateTimeFromOptionalAttributeDefaultValue()
        {
            Consolery.Run(typeof(OptionalDateTimeProgram), new[] { "01-01-2009", "/dtDate:31-12-2008" });

            Assert.That(_verifier.date, Is.EqualTo(new DateTime(2008, 12, 31)));
        }
示例#18
0
        public void WhenSpecifiedCaseForOptionalArgumentInconsistentWithActualParameters()
        {
            Consolery.Run(typeof(OnlyOptionalParametersProgram), new[] { "/-PARAMETER" });

            Assert.That(_verifier.parameter, Is.EqualTo(false));
        }
示例#19
0
        public void WhenMetadataValidationFailsShouldSetErrorCode()
        {
            Consolery.Run(typeof(ExceptionalProgram), new[] { "wrong" });

            Assert.That(Environment.ExitCode, Is.EqualTo(1));
        }
示例#20
0
        public void EnumDecimalTest()
        {
            Consolery.Run(typeof(EnumDecimalProgram), new[] { "1" });

            Assert.That(_verifier.d, Is.EqualTo(1));
        }
示例#21
0
        public void OnlyOptionalParametersSpecified()
        {
            Consolery.Run(typeof(OnlyOptionalParametersProgram), new string[] { });

            Assert.That(_verifier.parameter, Is.EqualTo(true));
        }
示例#22
0
        public void NullableParameter()
        {
            Consolery.Run(typeof(NullableParameterProgram), new[] { "10" });

            Assert.That(_verifier.i, Is.EqualTo(10));
        }
示例#23
0
        public void EnumParameterTest()
        {
            Consolery.Run(typeof(EnumParameterProgram), new[] { "One" });

            Assert.That(_verifier.testEnum, Is.EqualTo(TestEnum.One));
        }
示例#24
0
            public void ShouldShowHelpForAParticularMessage()
            {
                Consolery.Run(typeof(TwoActionsProgram), new[] { "help", "Test2" }, _messenger);

                Assert.That(ConsoleOutput().Contains("test2 parameter"));
            }
示例#25
0
 static void Main(string[] args)
 {
     Consolery.Run(typeof(FileSystemEntriesProcessor), args);
 }
示例#26
0
 static void Main(string[] args)
 {
     Consolery.Run(typeof(MainClass), args);
 }
示例#27
0
 public static void Main(string[] args)
 {
     Consolery.Run(typeof(Program), args);
 }
示例#28
0
        public void ShouldWorkWithoutArgumentsInAction()
        {
            Consolery.Run(typeof(WithoutArgumentsProgram), new[] { "Test" });

            Assert.That(_verifier.TestCalled, Is.True);
        }
示例#29
0
 static void Main(string[] args)
 {
     Consolery.Run();
 }
示例#30
0
        public void OneParameter()
        {
            Consolery.Run(typeof(OneParameterProgram), new[] { "parameter" });

            Assert.That(_verifier.parameter, Is.EqualTo("parameter"));
        }