예제 #1
0
        public void Stop_WhenNotStarted_DoesNothing()
        {
            var client = new MockSensuClient();

            _sut = new Pacemaker(client);
            _sut.Stop();
        }
예제 #2
0
        public void Start_WithPeriodOf1sec_Sends2MessagesIn2sec()
        {
            var client = new MockSensuClient();

            _sut = new Pacemaker(client);
            _sut.Start(new Heartbeat("testApp", 1));
            Thread.Sleep(1900);
            _sut.Stop();
            Assert.Equal(2, client.Messages.Count);
        }
예제 #3
0
        public void Stop_WhileHeardbeatRunning_StopsHeartbeat()
        {
            var client = new MockSensuClient();

            _sut = new Pacemaker(client);
            _sut.Start(new Heartbeat("testApp", 1));
            Thread.Sleep(5);
            _sut.Stop();
            Thread.Sleep(2000);
            Assert.Equal(1, client.Messages.Count);
        }
예제 #4
0
 public void Dispose()
 {
     _sut?.Stop();
     _sut = null;
 }