Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldNotTryToCloseAChannelThatHasBeenRemoved()
        public virtual void ShouldNotTryToCloseAChannelThatHasBeenRemoved()
        {
            // given
            FakeClock         clock             = Clocks.fakeClock();
            ChannelCloser     channelCloser     = mock(typeof(ChannelCloser));
            IdleChannelReaper idleChannelReaper = new IdleChannelReaper(channelCloser, _noLogging, clock, THRESHOLD);

            Channel        channel = mock(typeof(Channel));
            RequestContext request = DummyRequestContext();

            idleChannelReaper.Add(channel, request);

            // when
            idleChannelReaper.Remove(channel);
            clock.Forward(THRESHOLD + 1, TimeUnit.MILLISECONDS);
            idleChannelReaper.Run();

            // then
            verifyNoMoreInteractions(channelCloser);
        }