public static void Run()
        {
            var apiInstance = new InfoApi(Constants.GetConfig());

            // Get supported file formats
            var response = apiInstance.GetSupportedFileFormats();

            Console.WriteLine("GetSupportedFormats: formats count = " + response.Formats.Count);
        }
Esempio n. 2
0
        public void GetSupportedFileFormatsTest()
        {
            var response = InfoApi.GetSupportedFileFormats();

            Assert.IsTrue(response.Formats.Count > 0);
            foreach (var entry in response.Formats)
            {
                Assert.IsNotEmpty(entry.Extension);
                Assert.IsNotEmpty(entry.FileFormat);
            }
        }
Esempio n. 3
0
        public void TestGetFormats()
        {
            var result = InfoApi.GetSupportedFileFormats();

            Assert.IsTrue(result.Formats.Count > 0);
            foreach (var format in result.Formats)
            {
                Assert.IsNotNull(format.Extension);
                Assert.IsNotEmpty(format.Extension);

                Assert.IsNotNull(format.FileFormat);
                Assert.IsNotEmpty(format.FileFormat);
            }
        }
        public void AuthErrorWhenAppKeyNotFoundTest()
        {
            var appSid = Config.AppSid;
            var appKey = "test";

            var parserConfig = new Configuration(appSid, appKey)
            {
                ApiBaseUrl = Config.ApiBaseUrl
            };

            var infoApi = new InfoApi(parserConfig);

            var ex = Assert.Throws <ApiException>(() => { infoApi.GetSupportedFileFormats(); });

            Assert.AreEqual("invalid_client", ex.Message);
        }
Esempio n. 5
0
        public void StorageAuthenticationWrongKey()
        {
            var appSid = Config.AppSid;
            var appKey = "test";

            var config = new Configuration(appSid, appKey)
            {
                ApiBaseUrl = Config.ApiBaseUrl
            };

            var api = new InfoApi(config);

            var ex = Assert.Throws <ApiException>(() =>
            {
                api.GetSupportedFileFormats();
            });

            Assert.AreEqual("invalid_client", ex.Message);
        }
        public static void Run()
        {
            var apiInstance = new InfoApi(Constants.GetConfig());

            try
            {
                var response = apiInstance.GetSupportedFileFormats();

                foreach (var entry in response.Formats.Take(5))
                {
                    Console.WriteLine($"{entry.FileFormat}: {entry.Extension}");
                }
                Console.WriteLine($"...");
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception while calling InfoApi: " + e.Message);
            }
        }
Esempio n. 7
0
        public static void Run()
        {
            var apiInstance = new InfoApi(Common.GetConfig());

            try
            {
                // Get supported file formats
                var response = apiInstance.GetSupportedFileFormats();

                foreach (var entry in response.Formats)
                {
                    Console.WriteLine($"{entry.FileFormat}: {string.Join(",", entry.Extension)}");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception while calling InfoApi: " + e.Message);
            }
        }
Esempio n. 8
0
        public static void Run()
        {
            var configuration = new Configuration(Common.MyAppSid, Common.MyAppKey);
            var apiInstance   = new InfoApi(configuration);

            try
            {
                // Get supported file formats
                var response = apiInstance.GetSupportedFileFormats();

                foreach (var entry in response.Formats)
                {
                    Console.WriteLine($"{entry.FileFormat}: {entry.Extension}");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception while calling InfoApi: " + e.Message);
            }
        }