コード例 #1
0
        public void RequestShutdownWakesUpThreadSuspender()
        {
            // given
            var target = CreateSendingContext().Build();

            // when
            target.RequestShutdown();

            // then
            mockThreadSuspender.Received(1).WakeUp();
        }
コード例 #2
0
        public void ExecuteSleepsDefaultTimeIfSessionIsExpiredAndNoFurtherNonExpiredSessions()
        {
            // given
            mockTimingProvider.ProvideTimestampInMilliseconds().Returns(5L, 10L);
            mockSession.TryEnd().Returns(false);
            var target = CreateContext() as ISessionWatchdogContext;

            target.CloseOrEnqueueForClosing(mockSession, 3);

            // when
            target.Execute();

            // then
            mockThreadSuspender.Received(1).Sleep(SessionWatchdogContext.DefaultSleepTimeInMillis);
            mockSession.Received(1).End(false);
        }