Пример #1
0
        public void UriEncodingIsApplied()
        {
            UriServiceInfo r1 = new TestUriServiceInfo("myId", "http", "foo.bar", 1337, "SomeUser", "P4SSW0RD#", "baz");

            Assert.Equal("myId", r1.Id);
            Assert.Equal("http", r1.Scheme);
            Assert.Equal("foo.bar", r1.Host);
            Assert.Equal(1337, r1.Port);
            Assert.Equal("SomeUser", r1.UserName);
            Assert.Equal("P4SSW0RD#", r1.Password);
            Assert.Equal("baz", r1.Path);
            Assert.Null(r1.Query);
        }
Пример #2
0
        public void Constructor_CreatesExpected()
        {
            var            uri = "mysql://*****:*****@localhost:1527/big_db";
            UriServiceInfo r1  = new TestUriServiceInfo("myId", "mysql", "localhost", 1527, "joe", "joes_password", "big_db");
            UriServiceInfo r2  = new TestUriServiceInfo("myId", uri);

            Assert.Equal("myId", r1.Id);
            Assert.Equal("mysql", r1.Scheme);
            Assert.Equal("localhost", r1.Host);
            Assert.Equal(1527, r1.Port);
            Assert.Equal("joe", r1.UserName);
            Assert.Equal("joes_password", r1.Password);
            Assert.Equal("big_db", r1.Path);
            Assert.Null(r1.Query);

            Assert.Equal("myId", r2.Id);
            Assert.Equal("mysql", r2.Scheme);
            Assert.Equal("localhost", r2.Host);
            Assert.Equal(1527, r2.Port);
            Assert.Equal("joe", r2.UserName);
            Assert.Equal("joes_password", r2.Password);
            Assert.Equal("big_db", r2.Path);
            Assert.Null(r2.Query);
        }