public void RequestShutdownWakesUpThreadSuspender() { // given var target = CreateSendingContext().Build(); // when target.RequestShutdown(); // then mockThreadSuspender.Received(1).WakeUp(); }
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); }