示例#1
0
        public void it_can_handle_a_path_to_the_edgemart()
        {
            // Arrange
            var edgeMartPath = "folder/mart";
            var esUrl = new Url(String.Format("http://{0}:{1}/remote?edgemart={2}", SERVER_NAME, DEFAULT_PORT.ToString(), edgeMartPath));

            // Act
            var em = new EdgeMart<Object>(esUrl);

            // Assert
            Assert.AreEqual(edgeMartPath, em.AbsolutePath);
        }
示例#2
0
        public void it_can_be_created_with_a_url()
        {
            // Arrange
            var esUrl = new Url(String.Format("http://{0}:{1}/remote?edgemart={2}", SERVER_NAME, DEFAULT_PORT.ToString(), EDGEMART_NAME));

            // Act
            var em = new EdgeMart<Object>(esUrl);

            // Assert
            Assert.AreEqual(EDGEMART_NAME, em.Name);
            Assert.AreEqual(DEFAULT_PORT, em.Server.Port);
            Assert.AreEqual(SERVER_NAME, em.Server.Host);
        }
示例#3
0
        public void it_can_return_the_server_url()
        {
            // Arrange
            var esUrl = new Url(String.Format("http://{0}:{1}/remote?edgemart={2}", SERVER_NAME, DEFAULT_PORT.ToString(), EDGEMART_NAME));

            // Act
            var em = new EdgeMart<Object>(esUrl);

            // Assert
            Assert.AreEqual(String.Format("http://{0}:{1}/remote", SERVER_NAME, DEFAULT_PORT.ToString()), em.AbsoluteUri.ToString());
        }
示例#4
0
        public void it_requires_a_database_name_in_a_url()
        {
            // Arrange
            var esUrl = new Url(String.Format("http://{0}:{1}/remote", SERVER_NAME, DEFAULT_PORT.ToString()));
            EdgeMart em;

            // Act
            TestDelegate a = () => em = new EdgeMart<Object>(esUrl);

            // Assert
            Assert.Throws<ArgumentException>(a);
        }