public void op_Download_AbsoluteUri()
        {
            var expected = new FileInfo("example.xml").ReadToEnd();
            var actual   = XmlUriAttribute.Download("http://www.alan-dean.com/example.xml").ReadToEnd();

            Assert.Equal(expected, actual);
        }
示例#2
0
        public void op_GetData_MethodInfo_Types_whenParameterCountMismatch()
        {
            var obj = new XmlUriAttribute("http://www.alan-dean.com/one.xml", "http://www.alan-dean.com/two.xml");

            Assert.Throws<InvalidOperationException>(() => obj.GetData(GetType().GetMethod("usage"), new[] { typeof(XmlDocument) }).ToList());
        }
示例#3
0
        public void op_GetData_MethodInfo_Types_whenInvalidParameterType()
        {
            var obj = new XmlUriAttribute("http://www.alan-dean.com/example.xml");

            Assert.Throws<InvalidOperationException>(() => obj.GetData(GetType().GetMethod("usage"), new[] { typeof(string) }).ToList());
        }
示例#4
0
        public void op_GetData_MethodInfo_TypesNull()
        {
            var obj = new XmlUriAttribute("http://www.alan-dean.com/example.xml");

            Assert.Throws<ArgumentNullException>(() => obj.GetData(GetType().GetMethod("usage"), null).ToList());
        }
示例#5
0
        public void op_GetData_MethodInfoNull_Types()
        {
            var obj = new XmlUriAttribute("http://www.alan-dean.com/example.xml");

            Assert.Throws<ArgumentNullException>(() => obj.GetData(null, new[] { typeof(XmlDocument) }).ToList());
        }
        public void op_GetData_MethodInfo_Types_whenParameterCountMismatch()
        {
            var obj = new XmlUriAttribute("http://www.alan-dean.com/one.xml", "http://www.alan-dean.com/two.xml");

            Assert.Throws <InvalidOperationException>(() => obj.GetData(GetType().GetMethod("usage"), new[] { typeof(XmlDocument) }).ToList());
        }
        public void op_GetData_MethodInfo_Types_whenInvalidParameterType()
        {
            var obj = new XmlUriAttribute("http://www.alan-dean.com/example.xml");

            Assert.Throws <InvalidOperationException>(() => obj.GetData(GetType().GetMethod("usage"), new[] { typeof(string) }).ToList());
        }
        public void op_GetData_MethodInfo_TypesNull()
        {
            var obj = new XmlUriAttribute("http://www.alan-dean.com/example.xml");

            Assert.Throws <ArgumentNullException>(() => obj.GetData(GetType().GetMethod("usage"), null).ToList());
        }
        public void op_GetData_MethodInfoNull_Types()
        {
            var obj = new XmlUriAttribute("http://www.alan-dean.com/example.xml");

            Assert.Throws <ArgumentNullException>(() => obj.GetData(null, new[] { typeof(XmlDocument) }).ToList());
        }
 public void op_Download_AbsoluteUriNull()
 {
     Assert.Throws <ArgumentNullException>(() => XmlUriAttribute.Download(null));
 }
 public void op_Download_AbsoluteUriNotFound()
 {
     Assert.Throws <WebException>(() => XmlUriAttribute.Download("http://www.alan-dean.com/missing.xml"));
 }