public async Task Stop_NotRunning_Should_NotInvoke()
        {
            var mockSimpleProcess = CreateProcess();
            var runner            = new SimpleProcessRunner(mockSimpleProcess);
            var tryStart          = await runner.TryStop();

            tryStart.Message.Log();
            tryStart.Success.ShouldTrue();
            mockSimpleProcess.StopInvoked.ShouldFalse();
        }
Exemplo n.º 2
0
 private void Init(SimpleLoopTask loopTask, SimpleProcessRunner runner)
 {
     loopTask.LoopSpan   = TimeSpan.FromSeconds(3);
     loopTask.LoopAction = () =>
     {
         runner.TryStart();
     };
     loopTask.AfterExitLoopAction = () =>
     {
         runner.TryStop();
     };
 }