Пример #1
0
        public void TestingPropertiesWithTypeUri()
        {
            String         str     = "http://example.com/foo.html";
            Uri            value   = new Uri(str);
            ServiceElement element = new ServiceElement(ElementType.Url, value);

            Assert.AreEqual(ElementTypeDescriptor.Url, element.ElementTypeDescriptor);
            Assert.AreEqual(ElementType.Url, element.ElementType);
            Assert.AreEqual(new Uri(str), element.Value);
            Assert.AreEqual(new Uri(str), element.GetValueAsUri());
        }
Пример #2
0
        public void TestingPropertiesWithTypeUriLazyCreation()
        {
            String str = "ftp://ftp.example.com/foo/bar.txt";

            byte[]         valueBytes = Encoding.ASCII.GetBytes(str);
            ServiceElement element    = new ServiceElement(ElementType.Url, valueBytes);

            Assert.AreEqual(ElementTypeDescriptor.Url, element.ElementTypeDescriptor);
            Assert.AreEqual(ElementType.Url, element.ElementType);
            Assert.IsInstanceOfType(typeof(byte[]), element.Value);
            Assert.AreEqual(new Uri(str), element.GetValueAsUri());
        }