static void Main(string[] args)
    {
        ActionContainer execute = new ActionContainer();
        ProgramTest     prog    = new ProgramTest(execute);

        prog.AddMethod();
        execute.Action();
    }
    static void Main(string[] args)
    {
        Action      Execute = delegate { };
        ProgramTest prog    = new ProgramTest(ref Execute);

        prog.AddMethod();
        prog.execute();
    }
Beispiel #3
0
        public async Task when_running_with_version_arg_then_version_is_shown()
        {
            var program = new ProgramTest(output, new CommandFactory(), "--version");

            var exitCode = await program.RunAsync();

            Assert.Equal(0, exitCode);
            Assert.True(program.VersionShown);
        }
Beispiel #4
0
        public async Task when_running_without_args_or_with_help_arg_then_usage_is_shown(params string[] args)
        {
            var program = new ProgramTest(output, new CommandFactory(), args ?? new string[0]);

            var exitCode = await program.RunAsync();

            Assert.Equal(0, exitCode);
            Assert.True(program.UsageShown);
        }
Beispiel #5
0
    static void Main(string[] args)
    {
        ProgramTest prog = new ProgramTest();

        prog.AddMethod();

        // raise the event and invoke the registered handlers
        MyEvent?.Invoke(new MyArgs());
    }
Beispiel #6
0
 public static void Main(string[] args)
 {
     var p = new ProgramTest ();
     p.Task1Test ();
     p.Task2Test ();
     p.Task3Test ('a');
     p.Task3Test ('b');
     p.Task3Test ('c');
 }
    static void Main(string[] args)
    {
        ProgramTest prog = new ProgramTest();

        prog.AddMethod();

        // raise the event
        MyEvent?.Invoke(new MyArgs());
    }
Beispiel #8
0
    public static void Main(string[] args)
    {
        var p = new ProgramTest();

        p.Task1Test();
        p.Task2Test();
        p.Task3Test('a');
        p.Task3Test('b');
        p.Task3Test('c');
    }
Beispiel #9
0
    static void Main(string[] args)
    {
        Action Execute = delegate { };

        ProgramTest prog = new ProgramTest(h => Execute += h, h => Execute -= h);

        var subscription = prog.AddMethod();

        Execute();

        subscription.Dispose();
    }
Beispiel #10
0
        public void CargaInformaciónPorBulkSQLServer()
        {
            var                  summaryProgram           = BenchmarkRunner.Run <ProgramTest>();
            var                  startup                  = new Startup();
            List <StockCsv>      stockCsvs                = new List <StockCsv>();
            Task <ProcessStatus> responseServiceAzureFile = ProgramTest.ProcessAzureFile(startup);

            if (responseServiceAzureFile.Result == ProcessStatus.Success)
            {
                var responseByBulk = ProgramTest.SaveDataByBulk(startup);
            }

            int rows = sqlDao.GetTotalRows().Result;

            Assert.GreaterOrEqual(rows, 0);
        }
Beispiel #11
0
        public async Task when_descriptor_throws_show_usage_exception_then_command_usage_is_shown()
        {
            var commandDescriptor = new Mock <CommandDescriptor>();

            commandDescriptor.Setup(x => x.Parse(It.IsAny <IEnumerable <string> >())).Throws(new ShowUsageException(commandDescriptor.Object));

            var commandFactory = new CommandFactory();

            commandFactory.RegisterCommand("test", () => commandDescriptor.Object, x => null);

            var program = new ProgramTest(output, commandFactory, "test");

            var exitCode = await program.RunAsync();

            Assert.Equal(ErrorCodes.ShowUsage, exitCode);
            commandDescriptor.Verify(x => x.ShowUsage(It.IsAny <ITextWriter>()));
            Assert.True(program.ExamplesShown);
        }
Beispiel #12
0
 public void TestMethod1()
 {
     Assert.AreEqual("Hello World", ProgramTest.Display());
 }