//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldSkipReservedPorts() internal virtual void ShouldSkipReservedPorts() { PortRepository portRepository = mock(typeof(PortRepository)); PortProvider portProvider = new CoordinatingPortProvider(portRepository, port => false); when(portRepository.ReserveNextPort("foo")).thenReturn(40, 41, 43); assertThat(portProvider.GetNextFreePort("foo"), @is(40)); assertThat(portProvider.GetNextFreePort("foo"), @is(41)); assertThat(portProvider.GetNextFreePort("foo"), @is(43)); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test void shouldProvideUniquePorts() internal virtual void ShouldProvideUniquePorts() { PortRepository portRepository = mock(typeof(PortRepository)); PortProvider portProvider = new CoordinatingPortProvider(portRepository, port => false); when(portRepository.ReserveNextPort("foo")).thenReturn(40, 41); int port1 = portProvider.GetNextFreePort("foo"); int port2 = portProvider.GetNextFreePort("foo"); assertThat(port1, @is(not(equalTo(port2)))); }