Apache.NMS.Test.URISupportTest.TestParseCompositeWithFragment C# (CSharp) Method

TestParseCompositeWithFragment() private method

private TestParseCompositeWithFragment ( ) : void
return void
        public void TestParseCompositeWithFragment()
        {
            string uriString =
                "failover:(tcp://localhost:61616,ssl://remotehost:61617?param=true#fragment)#fragment";

            URISupport.CompositeData rc = URISupport.ParseComposite(new Uri(uriString));

            Assert.IsTrue(rc.Components.Length == 2);
            Assert.AreEqual("failover", rc.Scheme);
            Assert.AreEqual("#fragment", rc.Fragment);

            Uri uri1 = rc.Components[0];
            Uri uri2 = rc.Components[1];

            Assert.AreEqual("tcp", uri1.Scheme);
            Assert.AreEqual("ssl", uri2.Scheme);
            Assert.AreEqual("localhost", uri1.Host);
            Assert.AreEqual("remotehost", uri2.Host);
            Assert.AreEqual(61616, uri1.Port);
            Assert.AreEqual(61617, uri2.Port);
            Assert.IsTrue(String.IsNullOrEmpty(uri1.Fragment));
            Assert.IsNotNull(uri2.Fragment);
            Assert.AreEqual("#fragment", uri2.Fragment);
            Assert.AreEqual("?param=true", uri2.Query);
        }