示例#1
0
        public void op_Download_AbsoluteUri()
        {
            const string expected = "A1";
            var          actual   = CsvHttpAttribute.Download("http://www.alan-dean.com/example.csv").First()["A"];

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

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

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

            Assert.Throws <ArgumentNullException>(() => obj.GetData(GetType().GetMethod("usage"), null).ToList());
        }
示例#5
0
        public void op_GetData_MethodInfoNull_Types()
        {
            var obj = new CsvHttpAttribute("example.csv");

            Assert.Throws <ArgumentNullException>(() => obj.GetData(null, new[] { typeof(CsvDataSheet) }).ToList());
        }
示例#6
0
 public void op_Download_AbsoluteUriNull()
 {
     Assert.Throws <ArgumentNullException>(() => CsvHttpAttribute.Download(null));
 }
示例#7
0
 public void op_Download_AbsoluteUriNotFound()
 {
     Assert.Throws <WebException>(() => CsvHttpAttribute.Download("http://www.alan-dean.com/missing.csv"));
 }
        public void op_GetData_MethodInfo_Types_whenParameterCountMismatch()
        {
            var obj = new CsvHttpAttribute("http://www.alan-dean.com/one.csv", "http://www.alan-dean.com/two.csv");

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

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

            Assert.Throws<ArgumentNullException>(() => obj.GetData(GetType().GetMethod("usage"), null).ToList());
        }
示例#11
0
        public void op_GetData_MethodInfoNull_Types()
        {
            var obj = new CsvHttpAttribute("example.csv");

            Assert.Throws<ArgumentNullException>(() => obj.GetData(null, new[] { typeof(CsvDataSheet) }).ToList());
        }