Esempio n. 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);
        }
Esempio n. 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());
        }
Esempio n. 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());
        }
Esempio n. 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());
        }
Esempio n. 5
0
        public void op_GetData_MethodInfoNull_Types()
        {
            var obj = new CsvHttpAttribute("example.csv");

            Assert.Throws <ArgumentNullException>(() => obj.GetData(null, new[] { typeof(CsvDataSheet) }).ToList());
        }
Esempio n. 6
0
 public void op_Download_AbsoluteUriNull()
 {
     Assert.Throws <ArgumentNullException>(() => CsvHttpAttribute.Download(null));
 }
Esempio n. 7
0
 public void op_Download_AbsoluteUriNotFound()
 {
     Assert.Throws <WebException>(() => CsvHttpAttribute.Download("http://www.alan-dean.com/missing.csv"));
 }
Esempio n. 8
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());
        }
Esempio n. 9
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());
        }
Esempio n. 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());
        }
Esempio n. 11
0
        public void op_GetData_MethodInfoNull_Types()
        {
            var obj = new CsvHttpAttribute("example.csv");

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