コード例 #1
0
        public void op_GetData_MethodInfo_Types_whenInvalidParameterType()
        {
            var obj = new HtmlUriAttribute("http://www.alan-dean.com/example.html");

            Assert.Throws<InvalidOperationException>(() => obj.GetData(GetType().GetMethod("usage"), new[] { typeof(string) }).ToList());
        }
コード例 #2
0
        public void op_GetData_MethodInfo_Types_whenParameterCountMismatch()
        {
            var obj = new HtmlUriAttribute("http://www.alan-dean.com/one.html", "http://www.alan-dean.com/two.html");

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

            Assert.Throws<ArgumentNullException>(() => obj.GetData(null, new[] { typeof(XmlDocument) }).ToList());
        }
コード例 #4
0
        public void op_GetData_MethodInfo_TypesNull()
        {
            var obj = new HtmlUriAttribute("http://www.alan-dean.com/example.html");

            Assert.Throws<ArgumentNullException>(() => obj.GetData(GetType().GetMethod("usage"), null).ToList());
        }
コード例 #5
0
        public void op_GetData_MethodInfo_Types_whenInvalidParameterType()
        {
            var obj = new HtmlUriAttribute("http://www.alan-dean.com/example.html");

            Assert.Throws <InvalidOperationException>(() => obj.GetData(GetType().GetMethod("usage"), new[] { typeof(string) }).ToList());
        }
コード例 #6
0
        public void op_GetData_MethodInfo_Types_whenParameterCountMismatch()
        {
            var obj = new HtmlUriAttribute("http://www.alan-dean.com/one.html", "http://www.alan-dean.com/two.html");

            Assert.Throws <InvalidOperationException>(() => obj.GetData(GetType().GetMethod("usage"), new[] { typeof(XmlDocument) }).ToList());
        }
コード例 #7
0
        public void op_GetData_MethodInfo_TypesNull()
        {
            var obj = new HtmlUriAttribute("http://www.alan-dean.com/example.html");

            Assert.Throws <ArgumentNullException>(() => obj.GetData(GetType().GetMethod("usage"), null).ToList());
        }
コード例 #8
0
        public void op_GetData_MethodInfoNull_Types()
        {
            var obj = new HtmlUriAttribute("http://www.alan-dean.com/example.html");

            Assert.Throws <ArgumentNullException>(() => obj.GetData(null, new[] { typeof(XmlDocument) }).ToList());
        }
コード例 #9
0
 public void op_Download_AbsoluteUriNull()
 {
     Assert.Throws <ArgumentNullException>(() => HtmlUriAttribute.Download(null));
 }
コード例 #10
0
 public void op_Download_AbsoluteUriNotFound()
 {
     Assert.Throws <WebException>(() => HtmlUriAttribute.Download("http://www.alan-dean.com/missing.html"));
 }
コード例 #11
0
        public void op_Download_AbsoluteUri()
        {
            var navigator = HtmlUriAttribute.Download("http://www.alan-dean.com/example.html").CreateNavigator();

            Assert.True(navigator.Evaluate <bool>("1 = count(//title[text()='Example'])"));
        }