コード例 #1
0
    public static void Main()
    {
        Runner myRunner = new Runner();

        myRunner.Add("bob");
        myRunner.Add("fred");
    }
コード例 #2
0
 public void Method_Scenario_Result()
 {
     var runner = new Runner();
     runner.Add("Simon");
     runner.Add("Bary");
     runner.Add("John");
     runner.Add("Scot");
 }
コード例 #3
0
        static void Main(string[] args)
        {
            Runner oRunner = new Runner();

            oRunner.Add("Test Callback 1ed.");
            oRunner.Add("Test Callback 2ed.");
            oRunner.Add("Test Callback 3ed.");
            oRunner.Add("Test Callback 4ed.");

            Console.ReadKey();
        }
コード例 #4
0
        public void TestRunnerSetupAndRunSucceeds()
        {
            Runner runner = new Runner();

            runner.Add(new TestAgentFactory());
            runner.Add(new TestAgent("FunctionalTest3", 4));
            runner.Add(new TestAgent("FunctionalTest4", 5));

            runner.SetupAndRunWithLimit(1);

            Assert.AreEqual(4, runner.Agents.Count);
        }
コード例 #5
0
        public void TestRunnerSetupAndRunSucceeds()
        {
            Runner runner = new Runner();

            runner.Add(new TestAgentFactory());
            runner.Add(new TestAgent("FunctionalTest3", 4));
            runner.Add(new TestAgent("FunctionalTest4", 5));

            runner.SetupAndRunWithLimit(1);

            Assert.AreEqual(4, runner.Agents.Count);
        }
コード例 #6
0
        static void Main(string[] aArgs)
        {
            Helper helper = new Helper(aArgs);

            helper.ProcessCommandLine();

            Runner runner = new Runner("TestFramework runner tests");

            runner.Add(new SuiteTest1("Test1 suite"));
            runner.Add(new SuiteTest2("Test2 suite"));
            runner.Run();

            helper.Dispose();
        }
コード例 #7
0
ファイル: TestKeyBindings.cs プロジェクト: daviddw/oss-public
    public static void Main()
    {
        Runner runner = new Runner("KeyBindings Tests");

        runner.Add(new SuiteKeyToAction());
        runner.Run();
    }
コード例 #8
0
        public void TestRunnerReportContinuesWithNullAgentName()
        {
            Runner runner = new Runner();

            runner.Add(new TestAgent("", 4));
            runner.SetupAndRunWithLimit(1); // Should not raise an exception
        }
コード例 #9
0
        public void TestRunnerReportContinuesWithNegativeValue()
        {
            Runner runner = new Runner();

            runner.Add(new TestAgent("FunctionalTest", -10));
            runner.SetupAndRunWithLimit(1); // Should not raise an exception
        }
コード例 #10
0
 void Awake()
 {
     Runner.Add(new ChangeTextColourAction(_captionText, Color.white));
     Runner.Add(new FadeUpText(_captionText, "\r\nColour has brought danger with it!", 0.5f, 3, 1));
     Runner.Add(new FadeUpText("\r\nFrom the sky strange objects appear!", _captionText, 0.5f, 0, 1));
     Runner.Add(new ToggleActivateAction(_strangeObjectSpawner, true));
     Runner.Add(new PerformAction(() =>
     {
         var spawner = _strangeObjectSpawner.GetComponent <StrangeObjectSpawner>();
         spawner.EnableDrop(true);
     }));
     Runner.Add(new WaitAction(5));
     Runner.Add(new FadeUpText("\r\nFrom the sky strange objects appear!", _captionText, 0.5f, 1, 0));
     Runner.Add(new FadeUpText(_captionText, "\r\nWatch out!!", 0.5f, 1, 1));
     Runner.Add(new FadeUpText(_captionText, "\r\nThose things look dangerous!", 0.5f, 1, 1));
     Runner.Add(new WaitAction(5));
     Runner.Add(new ToggleActivateAction(_strangeObjectSpawner, false));
     Runner.Add(new PerformAction(() =>
     {
         var spawner = _strangeObjectSpawner.GetComponent <StrangeObjectSpawner>();
         spawner.EnableDrop(false);
     }));
     Runner.Add(new FadeUpText(_captionText, "\r\nThe storm subsides and peace is restored.", 0.5f, 1, 1));
     Runner.Add(new ToggleActivateAction(_nextStoryPoint, true));
 }
コード例 #11
0
        public static void DoSample()
        {
            Runner       runner       = new Runner();
            AnotherClass anotherClass = new AnotherClass();

            runner.Add("a");
            ////anotherClass.DoSomeThing();
        }
コード例 #12
0
        public void TestPollCycleRunsEvery60Seconds()
        {
            Runner runner = new Runner();

            runner.Add(new TestAgent("", 4));
            runner.SetupAndRun();
            Thread.Sleep(10 * 60 * 1000 + 50);            //sleep for a little over 10 minutes
            Assert.AreEqual(runner.PollCycleCounter, 10); //check if 10 transmissions have occured
        }
コード例 #13
0
 void Awake()
 {
     Runner.Add(new FadeCanvas(_blackout, 1, 0, 1));
     Runner.Add(new FadeCanvas(_endGameText, 1, 0, 1));
     Runner.Add(new PerformAction(() =>
     {
         _running = true;
     }));
 }
コード例 #14
0
    public static void Main(string[] aArgs)
    {
        App app = new App(aArgs);

        app.Start();

        Runner runner = new Runner("RoomSourceSelection tests");

        runner.Add(new SuiteRoomSourceSubscriptionTests());
        runner.Run();
    }
コード例 #15
0
ファイル: TestModules.cs プロジェクト: H-Core/H.Services
        public static IRunner CreateRunnerWithRunCommand()
        {
            var runner = new Runner();

            runner.Add(SyncAction.WithCommand(
                           "run",
                           command => runner.Run(
                               new Command(
                                   command.Input.Arguments.ElementAt(0),
                                   command.Input.Arguments.Skip(1).ToArray())),
                           "command"));
            runner.Add(AsyncAction.WithCommand(
                           "run-async",
                           (command, token) => runner.RunAsync(
                               new Command(
                                   command.Input.Arguments.ElementAt(0),
                                   command.Input.Arguments.Skip(1).ToArray()),
                               token),
                           "command"));

            return(runner);
        }
コード例 #16
0
ファイル: TestDidlLite.cs プロジェクト: daviddw/oss-public
        static void Main(string[] aArgs)
        {
            Helper helper = new Helper(aArgs);

            helper.ProcessCommandLine();

            Runner runner = new Runner("Didl Lite tests");

            runner.Add(new SuiteDidlLite());
            runner.Run();

            helper.Dispose();
        }
コード例 #17
0
    static void Main(string[] aArgs)
    {
        Helper helper = new Helper(aArgs);

        helper.ProcessCommandLine();

        Runner runner = new Runner("Some Linn C# timer tests");

        runner.Add(new SuiteTimer());
        runner.Run();

        helper.Dispose();
    }
コード例 #18
0
    static void Main(string[] aArgs)
    {
        Helper helper = new Helper(aArgs);

        helper.ProcessCommandLine();

        Runner runner = new Runner("Option Parser module tests");

        runner.Add(new SuiteOptionParser());
        runner.Run();

        helper.Dispose();
    }
コード例 #19
0
 public void TestRunnerSetupFailsWithNullAgent()
 {
     try
     {
         Runner runner = new Runner();
         Agent agent = null;
         runner.Add(agent);
         Assert.Fail("Runner should raise exception when null agent is passed");
     }
     catch (ArgumentNullException)
     {
         // Expected
     }
 }
コード例 #20
0
 public void TestRunnerSetupFailsWithNullAgent()
 {
     try
     {
         Runner runner = new Runner();
         Agent  agent  = null;
         runner.Add(agent);
         Assert.Fail("Runner should raise exception when null agent is passed");
     }
     catch (ArgumentNullException)
     {
         // Expected
     }
 }
コード例 #21
0
 void Awake()
 {
     Runner.Add(new FadeUpText(_captionText, "Every story has an end, every journey has a destination.", 1, 5, 1));
     Runner.Add(new FadeUpText(_captionText, "For the creature the journey ends with enlightenment.", 1, 5, 1));
     Runner.Add(new ToggleActivateAction(_spawner, true));
     Runner.Add(new FadeUpText(_captionText, "The creature sees the messages appear above and must raise itself to reach them.", 1, 5, 1));
     Runner.Add(new PerformAction(() =>
     {
         var spawner = _spawner.GetComponent <StrangeObjectSpawner>();
         spawner.EnableDrop(true);
         _locomotion.EnableJump(true);
         _locomotion.EnlightenmentAchieved += Locomotion_EnlightenmentAchieved;
     }));
 }
コード例 #22
0
ファイル: TestModules.cs プロジェクト: H-Core/H.Services
        public static IRunner CreateAliasRunnerCommand(string name, params string[] aliases)
        {
            var runner = new Runner();

            foreach (var alias in aliases)
            {
                runner.Add(SyncAction.WithCommand(
                               alias,
                               command => runner.Run(new Command(name, command.Input.Arguments)),
                               "arguments"));
            }

            return(runner);
        }
コード例 #23
0
 static void Main(string[] args)
 {
     try
     {
         Runner runner = new Runner();
         runner.Add(new ServiceAgentFactory());
         runner.SetupAndRun();
     }
     catch (Exception ex)
     {
         log.Error("Failed to start the windows services plugin. " + ex.Message);
         return;
     }
 }
コード例 #24
0
        static void Main(string[] args)
        {
            try
            {
                Runner runner = new Runner();

                runner.Add(new MSMQAgentFactory());

                runner.SetupAndRun();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception occurred, unable to continue.\n", e.Message);
            }
        }
コード例 #25
0
 static int Main(string[] args)
 {
     try
     {
         var runner = new Runner();
         runner.Add(new RedisAgentFactory());
         runner.SetupAndRun();
         return(0);
     }
     catch (Exception ex)
     {
         Trace.WriteLine("EXCEPTION: " + ex.Message);
         return(-1);
     }
 }
コード例 #26
0
        /// <summary>
        /// Start the Runner. NewRelic Runner is the main entrypoint class for the SDK. Essentially you will create an instance of a Runner,
        /// assign either your programmatically configured Agents or your AgentFactory to it, and then call SetupAndRun()
        /// which will begin invoking the PollCycle() method on each of your Agents once per polling interval.
        /// </summary>
        public void Start()
        {
            _pollThread = new Thread(() =>
            {
                var runner = new Runner();

                // You can add either a factory to generate Components from a configuration file or
                // you can directly add a component programmatically
                runner.Add(new QueueAgentFactory(_eventLogLogger));

                runner.SetupAndRun();
            });

            _pollThread.Start();
        }
コード例 #27
0
ファイル: Program.cs プロジェクト: ogaudefroy/yanrpp
 public static int Main(string[] args)
 {
     try
     {
         Runner runner = new Runner();
         runner.Add(new PerfmonAgentFactory());
         runner.SetupAndRun();
     }
     catch (Exception e)
     {
         Console.Error.WriteLine("An error occured : {0}", e.Message);
         Console.Error.WriteLine(e.StackTrace);
         return(-1);
     }
     return(0);
 }
コード例 #28
0
    void Awake()
    {
        _sky    = Camera.main.backgroundColor;
        _skyNew = new Color(62 / 255f, 189 / 255f, 224 / 255f);

        _groundMaterialStart   = _ground.material;
        _creatureMaterialStart = _creature.material;

        Runner.Add(new FadeCanvas(_blackoutCurtain, 0f, 0f, 0f));
        Runner.Add(new ChangeTextColourAction(_captionText, Color.black));
        Runner.Add(new ActivateCreatureAction(_locomotion, true));

        Runner.Add(new WaitAction(5));
        Runner.Add(new FadeUpText(_captionText, "This new world seemed a desolate place devoid of colour.", 0.5f, 5, 1));
        Runner.Add(new FadeUpText(_captionText, "The unseen hand uses the creature to paint colour into the world.", 0.5f, 5, 1));
        Runner.Add(new PerformAction(AddEventHandler));
    }
コード例 #29
0
        private static int Main(string[] args)
        {
            Logger.Info("Starting Plugin");
            try
            {
                var runner = new Runner();
                runner.Add(new RabbitAgentFactory());
                runner.SetupAndRun();
            }
            catch (Exception e)
            {
                Logger.Error("Exception occurred, unable to continue.\n{0}", e.Message);
                return(-1);
            }

            Logger.Info("Exiting Plugin");
            return(0);
        }
コード例 #30
0
 void Awake()
 {
     Runner.Add(new WaitAction(2));
     Runner.Add(new FadeUpText(_captionText, "In the beginning there was nothing.\r\nJust darkness everywhere...", 1, 5, 1));
     Runner.Add(new FadeUpText(_captionText, "All it would take is a flash of inspiration.\r\nA spark of light!", 1, 5, 1));
     Runner.Add(new PlaySoundAction(_thunderClap, _audioSource));
     Runner.Add(new FadeCanvas(_canvas, 0.1f, 0.8f, 0.1f));
     Runner.Add(new FadeCanvas(_canvas, 0.1f, 0.5f, 0.1f));
     Runner.Add(new FadeCanvas(_canvas, 0.1f, 0.8f, 0.1f));
     Runner.Add(new FadeCanvas(_canvas, 0.1f, 0.1f, 1f));
     Runner.Add(new WaitAction(5));
     Runner.Add(new FadeCanvas(_canvas, 1, 1, 0));
     Runner.Add(new ChangeTextColourAction(_captionText, Color.black));
     Runner.Add(new FadeUpText(_captionText, "The world had formed as an infinite white plane.", 1, 5, 1));
     Runner.Add(new FadeUpText(_captionText, "No creatures or plants lived in this world.\r\nNothing grew and nothing walked its surface.", 1, 5, 1));
     Runner.Add(new WaitAction(2));
     Runner.Add(new FadeUpText(_captionText, "\r\nUntil one day...", 0.5f, 2, 3));
     Runner.Add(new ToggleActivateAction(_nextStoryPoint, true));
 }
コード例 #31
0
        static int Main(string[] args)
        {
            try
            {
                CheckConfigFiles();
                Runner runner = new Runner();

                runner.Add(new VTMAgentFactory());

                runner.SetupAndRun();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception occurred, unable to continue.\nMessage: {0}", e.Message);
                return(-1);
            }

            return(0);
        }
コード例 #32
0
        static int Main(string[] args)
        {
            try
            {
                //Validate config files
                CheckConfigFile();

                //Start New Relic Plugin
                Runner runner = new Runner();
                runner.Add(new PluginAgentFactory());
                runner.SetupAndRun();
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception occured, unable to continue.\nMessage: {0}", e.Message);
                return(-1);
            }

            return(0);
        }
コード例 #33
0
 void Awake()
 {
     foreach (var block in _blocks)
     {
         Runner.Add(new ToggleActivateAction(block, false));
     }
     Runner.Add(new FadeCanvas(_canvasGroup, 0f, 0f, 0f));
     Runner.Add(new ChangeTextColourAction(_captionText, Color.black));
     Runner.Add(new FadeUpText(_captionText, "\r\nSuddenly something appeared...", 0.5f, 3, 1));
     Runner.Add(new LerpObjectToAction(_cube, 0.5f, new Vector3(-13, -0.91f, 0)));
     Runner.Add(new FadeUpText(_captionText, "\r\nIs that... life?", 0.1f, 3, 1));
     Runner.Add(new WaitAction(2));
     Runner.Add(new LerpObjectToAction(_cube, 0.5f, new Vector3(0, -0.91f, 0)));
     Runner.Add(new FadeUpText(_captionText, "The strange creature needed encouragement to move.", 0.5f, 3, 1));
     Runner.Add(new FadeUpText(_captionText, "As if some external force was pulling it left or right.", 0.5f, 4, 1));
     Runner.Add(new ActivateCreatureAction(_locomotion, true));
     foreach (var block in _blocks)
     {
         Runner.Add(new ToggleActivateAction(block, true));
     }
     Runner.Add(new ToggleActivateAction(_nextStoryPoint, true));
 }
コード例 #34
0
 public void TestRunnerReportContinuesWithNegativeValue()
 {
     Runner runner = new Runner();
     runner.Add(new TestAgent("FunctionalTest", -10));
     runner.SetupAndRunWithLimit(1); // Should not raise an exception
 }
コード例 #35
0
 public void TestRunnerReportContinuesWithNullAgentName()
 {
     Runner runner = new Runner();
     runner.Add(new TestAgent("", 4));
     runner.SetupAndRunWithLimit(1); // Should not raise an exception
 }