private IDictionary <string, object> ToMap(DiscoverableURIs uris) { IDictionary <string, object> @out = new Dictionary <string, object>(); uris.ForEach((k, v) => @out.put(k, v.toASCIIString())); return(@out); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldNotInvokeConsumerWhenEmpty() public virtual void ShouldNotInvokeConsumerWhenEmpty() { DiscoverableURIs empty = (new DiscoverableURIs.Builder()).Build(); empty.ForEach(_consumer); verify(_consumer, never()).accept(anyString(), any()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldConvertSchemeHostPortIntoURI() throws java.net.URISyntaxException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldConvertSchemeHostPortIntoURI() { DiscoverableURIs empty = (new DiscoverableURIs.Builder()).Add("a", "bolt", "www.example.com", 8888, NORMAL).build(); empty.ForEach(_consumer); verify(_consumer, times(1)).accept("a", new URI("bolt://www.example.com:8888")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldConvertStringIntoURI() throws java.net.URISyntaxException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldConvertStringIntoURI() { DiscoverableURIs empty = (new DiscoverableURIs.Builder()).add("a", "bolt://localhost:7687", NORMAL).Build(); empty.ForEach(_consumer); verify(_consumer, times(1)).accept("a", new URI("bolt://localhost:7687")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldInvokeConsumerForEachKeyWithHighestPrecedenceOnce() throws java.net.URISyntaxException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldInvokeConsumerForEachKeyWithHighestPrecedenceOnce() { DiscoverableURIs discoverables = (new DiscoverableURIs.Builder()).add("a", "/test1", LOWEST).add("a", "/test2", LOW).add("a", "/data3", NORMAL).add("a", "/test4", HIGH).add("a", "/test5", HIGHEST).Build(); discoverables.ForEach(_consumer); verify(_consumer, only()).accept("a", new URI("/test5")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldOverrideLowestForAbsolute() throws java.net.URISyntaxException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldOverrideLowestForAbsolute() { URI @override = new URI("http://www.example.com:9999"); DiscoverableURIs empty = (new DiscoverableURIs.Builder()).add("a", "bolt://localhost:8989", LOWEST).OverrideAbsolutesFromRequest(@override).build(); empty.ForEach(_consumer); verify(_consumer, times(1)).accept("a", new URI("bolt://www.example.com:8989")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldInvokeConsumerForEachKey() throws java.net.URISyntaxException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldInvokeConsumerForEachKey() { DiscoverableURIs discoverables = (new DiscoverableURIs.Builder()).add("a", "/test", NORMAL).add("b", "/data", NORMAL).add("c", "http://www.example.com", LOW).Build(); discoverables.ForEach(_consumer); verify(_consumer, times(1)).accept("a", new URI("/test")); verify(_consumer, times(1)).accept("b", new URI("/data")); verify(_consumer, times(1)).accept("c", new URI("http://www.example.com")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldUsePassedURI() throws java.net.URISyntaxException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldUsePassedURI() { URI uri = new URI("bolt://www.example.com:9999"); DiscoverableURIs empty = (new DiscoverableURIs.Builder()).add("a", uri, NORMAL).Build(); empty.ForEach(_consumer); verify(_consumer, times(1)).accept("a", uri); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldInvokeConsumerForEachKeyWithHighestPrecedence() throws java.net.URISyntaxException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldInvokeConsumerForEachKeyWithHighestPrecedence() { DiscoverableURIs discoverables = (new DiscoverableURIs.Builder()).add("c", "bolt://localhost:7687", HIGHEST).add("a", "/test", NORMAL).add("b", "/data", NORMAL).add("b", "/data2", LOWEST).add("a", "/test2", HIGHEST).add("c", "bolt://localhost:7688", LOW).Build(); discoverables.ForEach(_consumer); verify(_consumer, times(1)).accept("a", new URI("/test2")); verify(_consumer, times(1)).accept("b", new URI("/data")); verify(_consumer, times(1)).accept("c", new URI("bolt://localhost:7687")); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldNotOverrideOtherThanLowestForAbsolute() throws java.net.URISyntaxException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldNotOverrideOtherThanLowestForAbsolute() { URI @override = new URI("http://www.example.com:9999"); DiscoverableURIs empty = (new DiscoverableURIs.Builder()).add("a", "bolt://localhost:8989", LOW).add("b", "bolt://localhost:8990", NORMAL).add("c", "bolt://localhost:8991", HIGH).add("d", "bolt://localhost:8992", HIGHEST).OverrideAbsolutesFromRequest(@override).build(); empty.ForEach(_consumer); verify(_consumer, times(1)).accept("a", new URI("bolt://localhost:8989")); verify(_consumer, times(1)).accept("b", new URI("bolt://localhost:8990")); verify(_consumer, times(1)).accept("c", new URI("bolt://localhost:8991")); verify(_consumer, times(1)).accept("d", new URI("bolt://localhost:8992")); }