public void Parse_InvalidUris() { Assert.Null(EpoxyTransport.Parse(null, LoggerTests.BlackHole)); Assert.Null(EpoxyTransport.Parse(string.Empty, LoggerTests.BlackHole)); Assert.Null(EpoxyTransport.Parse("127.0.0.1", LoggerTests.BlackHole)); Assert.Null(EpoxyTransport.Parse("cows", LoggerTests.BlackHole)); Assert.Null(EpoxyTransport.Parse(":12", LoggerTests.BlackHole)); Assert.Null(EpoxyTransport.Parse("epoxy://127.0.0.1:1000:1000", LoggerTests.BlackHole)); }
public void Parse_AcceptableUris() { var endpoint = EpoxyTransport.Parse("epoxy://127.0.0.1", LoggerTests.BlackHole); Assert.NotNull(endpoint); Assert.AreEqual("127.0.0.1", endpoint.Value.Host); Assert.AreEqual(EpoxyTransport.DefaultInsecurePort, endpoint.Value.Port); Assert.False(endpoint.Value.UseTls); endpoint = EpoxyTransport.Parse("epoxy://127.0.0.1/", LoggerTests.BlackHole); Assert.NotNull(endpoint); Assert.AreEqual("127.0.0.1", endpoint.Value.Host); Assert.AreEqual(EpoxyTransport.DefaultInsecurePort, endpoint.Value.Port); Assert.False(endpoint.Value.UseTls); endpoint = EpoxyTransport.Parse("epoxy://127.0.0.1:10000", LoggerTests.BlackHole); Assert.NotNull(endpoint); Assert.AreEqual("127.0.0.1", endpoint.Value.Host); Assert.AreEqual(10000, endpoint.Value.Port); Assert.False(endpoint.Value.UseTls); endpoint = EpoxyTransport.Parse("epoxy://127.0.0.1:10000/", LoggerTests.BlackHole); Assert.NotNull(endpoint); Assert.AreEqual("127.0.0.1", endpoint.Value.Host); Assert.AreEqual(10000, endpoint.Value.Port); Assert.False(endpoint.Value.UseTls); endpoint = EpoxyTransport.Parse("epoxy://localhost", LoggerTests.BlackHole); Assert.NotNull(endpoint); Assert.AreEqual("localhost", endpoint.Value.Host); Assert.AreEqual(EpoxyTransport.DefaultInsecurePort, endpoint.Value.Port); Assert.False(endpoint.Value.UseTls); endpoint = EpoxyTransport.Parse("epoxy://localhost/", LoggerTests.BlackHole); Assert.NotNull(endpoint); Assert.AreEqual("localhost", endpoint.Value.Host); Assert.AreEqual(EpoxyTransport.DefaultInsecurePort, endpoint.Value.Port); Assert.False(endpoint.Value.UseTls); endpoint = EpoxyTransport.Parse("epoxy://localhost:10000", LoggerTests.BlackHole); Assert.NotNull(endpoint); Assert.AreEqual("localhost", endpoint.Value.Host); Assert.AreEqual(10000, endpoint.Value.Port); Assert.False(endpoint.Value.UseTls); endpoint = EpoxyTransport.Parse("epoxy://localhost:10000/", LoggerTests.BlackHole); Assert.NotNull(endpoint); Assert.AreEqual("localhost", endpoint.Value.Host); Assert.AreEqual(10000, endpoint.Value.Port); Assert.False(endpoint.Value.UseTls); }
public void Parse_EpoxysUris() { var endpoint = EpoxyTransport.Parse("epoxys://use-default-secure-port", LoggerTests.BlackHole); Assert.NotNull(endpoint); Assert.AreEqual("use-default-secure-port", endpoint.Value.Host); Assert.AreEqual(EpoxyTransport.DefaultSecurePort, endpoint.Value.Port); Assert.True(endpoint.Value.UseTls); endpoint = EpoxyTransport.Parse("epoxys://use-custom-port:10000/", LoggerTests.BlackHole); Assert.NotNull(endpoint); Assert.AreEqual("use-custom-port", endpoint.Value.Host); Assert.AreEqual(10000, endpoint.Value.Port); Assert.True(endpoint.Value.UseTls); }
public void Parse_NoResourceBesidesRootOrParamsAllowed() { Assert.Null(EpoxyTransport.Parse("epoxy://127.0.0.1/cows", LoggerTests.BlackHole)); Assert.Null(EpoxyTransport.Parse("epoxy://127.0.0.1?cows=cows", LoggerTests.BlackHole)); }
public void Parse_SchemeMustBeEpoxyish() { Assert.Null(EpoxyTransport.Parse("http://127.0.0.1", LoggerTests.BlackHole)); }