public void should_not_be_able_to_stop_a_not_running_service() { var sut = new TestAppService(); Action actual = sut.Stop; actual.ShouldThrow <InvalidOperationException>(); }
public void should_not_be_able_to_stop_a_not_running_service() { var sut = new TestAppService(); Action actual = sut.Stop; actual.ShouldThrow<InvalidOperationException>(); }
public void start_service_ok() { var sut = new TestAppService(); sut.Start(); sut.StartedEvent.WaitOne(100).Should().BeTrue(); }
public void start_after_initial_delay() { var sut = new TestAppService(); sut.Start(); sut.StartedEvent.WaitOne(600).Should().BeTrue(); }
public void started_service_should_be_marked_as_IsRunning_even_before_first_run() { var sut = new TestAppService(); sut.FirstInterval = TimeSpan.Zero; sut.Start(); sut.IsRunning.Should().BeTrue(); }
public void do_not_start_before_inital_delay() { var sut = new TestAppService(); sut.Start(); Thread.Sleep(300); sut.StartedEvent.WaitOne(0).Should().BeFalse(); }
public void started_service_should_be_marked_as_IsRunning() { var sut = new TestAppService(); sut.Start(); sut.StartedEvent.WaitOne(100).Should().BeTrue(); Action actual = sut.Start; actual.ShouldThrow <InvalidOperationException>(); }
public void should_not_be_able_to_Start_twice() { var sut = new TestAppService(); sut.Start(); sut.StartedEvent.WaitOne(100).Should().BeTrue(); Action actual = sut.Start; actual.ShouldThrow<InvalidOperationException>(); }
public void started_service_should_be_marked_as_IsRunning() { var sut = new TestAppService(); sut.Start(); sut.StartedEvent.WaitOne(100).Should().BeTrue(); Action actual = sut.Start; actual.ShouldThrow<InvalidOperationException>(); }
public void should_not_be_able_to_Start_twice() { var sut = new TestAppService(); sut.Start(); sut.StartedEvent.WaitOne(100).Should().BeTrue(); Action actual = sut.Start; actual.ShouldThrow <InvalidOperationException>(); }
public void should_not_be_able_to_Start_twice() { var sut = new TestAppService(); sut.FirstInterval = TimeSpan.FromMilliseconds(0); sut.Start(); sut.StartedEvent.WaitOne(100).Should().BeTrue(); Action actual = sut.Start; actual.Should().Throw <InvalidOperationException>(); }
public void will_not_crash_when_Run_throws_exception_and_log_func_is_not_set() { var sut = new TestAppService(); sut.WorkFunc = () => { throw new InvalidOperationException(); }; sut.Start(); sut.StartedEvent.WaitOne(10000); sut.Stop(); var actual = sut.StoppedEvent.WaitOne(10000); actual.Should().BeFalse(); }
public void should_be_able_to_restart() { var sut = new TestAppService(); sut.Start(); sut.StartedEvent.WaitOne(10000); sut.Stop(); sut.StoppedEvent.WaitOne(10000); sut.StartedEvent.Reset(); sut.Start(); sut.StartedEvent.WaitOne(10000).Should().BeTrue(); }
public void should_be_able_to_restart() { var sut = new TestAppService(); sut.Start(); sut.StartedEvent.WaitOne(100); sut.Stop(); sut.StoppedEvent.WaitOne(100); sut.StartedEvent.Reset(); sut.Start(); sut.StartedEvent.WaitOne(100).Should().BeTrue(); }
public void should_be_able_to_restart() { var sut = new TestAppService(); sut.FirstInterval = TimeSpan.FromMilliseconds(0); sut.Start(); sut.StartedEvent.WaitOne(10000); sut.Stop(); sut.StoppedEvent.WaitOne(10000); sut.StartedEvent.Reset(); sut.Start(); sut.StartedEvent.WaitOne(10000).Should().BeTrue(); }
public void waits_on_handle_after_restarted() { var sut = new TestAppService(); sut.WorkFunc = handle => handle.WaitOne(500); sut.Start(); sut.StartedEvent.WaitOne(100); sut.Stop(); sut.StoppedEvent.WaitOne(100); sut.StartedEvent.Reset(); sut.Start(); sut.StartedEvent.WaitOne(100).Should().BeTrue(); }
public void waits_on_handle_after_restarted() { var sut = new TestAppService(); sut.WorkFunc = handle => handle.WaitOne(500); sut.Start(); sut.StartedEvent.WaitOne(10000); sut.Stop(); sut.StoppedEvent.WaitOne(10000); sut.StartedEvent.Reset(); sut.Start(); sut.StartedEvent.WaitOne(100).Should().BeTrue(); }
static void Main(string[] args) { TestAppService test = new TestAppService(); ProcessStartInfo appToTest = test.GetTestApp(); CpuTempService cpuTempService = new CpuTempService(appToTest); var results = cpuTempService.MeasureTemperature(); Console.WriteLine($"Termination result: {results.termReason}"); if (results.coreName != null) { Console.WriteLine($"Core that passed threshold: {results.coreName}"); Console.WriteLine($"Temp of {results.coreName}: {results.coreTemp} degress C."); } Console.WriteLine($"Total uptime {results.appRunTime.Elapsed.ToString(@"hh\:mm\:ss\:fff")}"); Console.ReadLine(); }
public DemoCache_Tests() { _testAppService = Resolve <TestAppService>(); }
public TestController(TestAppService appService) { this.appService = appService; }