コード例 #1
0
        public void FormattedDataSetRequest_allows_xml_and_csv_dataset_formats()
        {
            var req = new TestFormattedRequest("TEST PROJECT", "DEV");

            req.GetFormatExtension("CSV");
            req.GetFormatExtension("csv");
            req.GetFormatExtension("XML");
            req.GetFormatExtension("xml");
        }
コード例 #2
0
        public void FormattedDataSetRequest_does_not_allow_erroneous_dataset_formats()
        {
            var req = new TestFormattedRequest("TEST PROJECT", "DEV");

            string[] formatsToTry = { "xls", "xlsx", "doc" };

            foreach (var format in formatsToTry)
            {
                try
                {
                    req.GetFormatExtension(format);
                }
                catch (NotSupportedException e)
                {
                    Assert.IsTrue(e.Message.Contains($"`{format}` is not valid."));
                }
            }
        }