//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldRetainLockWhileStreaming() throws Exception //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldRetainLockWhileStreaming() { // given ChannelPromise channelPromise = _embeddedChannel.newPromise(); ChannelHandlerContext channelHandlerContext = mock(typeof(ChannelHandlerContext)); when(channelHandlerContext.writeAndFlush(any(typeof(PrepareStoreCopyResponse)))).thenReturn(channelPromise); ReentrantReadWriteLock @lock = new ReentrantReadWriteLock(); when(_neoStoreDataSource.StoreCopyCheckPointMutex).thenReturn(new StoreCopyCheckPointMutex(@lock)); PrepareStoreCopyRequestHandler subjectHandler = CreateHandler(); // and LongSet indexIds = LongSets.immutable.of(42); File[] files = new File[] { new File("file") }; long lastCheckpoint = 1; ConfigureProvidedStoreCopyFiles(new StoreResource[0], files, indexIds, lastCheckpoint); // when subjectHandler.ChannelRead0(channelHandlerContext, new PrepareStoreCopyRequest(_storeIdMatching)); // then assertEquals(1, @lock.ReadLockCount); // when channelPromise.setSuccess(); //then assertEquals(0, @lock.ReadLockCount); }