当前位置: 首页>>代码示例>>C#>>正文


C# IApi.report方法代码示例

本文整理汇总了C#中IApi.report方法的典型用法代码示例。如果您正苦于以下问题:C# IApi.report方法的具体用法?C# IApi.report怎么用?C# IApi.report使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IApi的用法示例。


在下文中一共展示了IApi.report方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestReportWithNoUsage

        public void TestReportWithNoUsage()
        {
            m_api = new Api(host, provider_key);

            Hashtable transactions = new Hashtable();
            Hashtable transaction = new Hashtable();
            transaction.Add("app_id", app_id);
            transaction.Add("app_key", app_key);

            Hashtable usage = new Hashtable();
            transaction.Add("usage", usage);

            transactions.Add("0", transaction);


            var ex = Assert.Throws<ApiException>( () => m_api.report(transactions));
            Assert.That(ex.Message, Is.EqualTo("argument error: undefined transaction, usage is missing in one record"));
        }
开发者ID:blas-dmx,项目名称:3scale_ws_api_for_dotnet,代码行数:18,代码来源:ApiTest.cs

示例2: TestReportWithNoTransactions

        public void TestReportWithNoTransactions()
        {
            m_api = new Api(host, provider_key);

            Hashtable transactions = new Hashtable();

            var ex = Assert.Throws<ApiException>( () => m_api.report(transactions));
            Assert.That(ex.Message, Is.EqualTo("argument error: undefined transactions, must be at least one"));
        }
开发者ID:blas-dmx,项目名称:3scale_ws_api_for_dotnet,代码行数:9,代码来源:ApiTest.cs

示例3: TestReportWithEmptyTransaction

        public void TestReportWithEmptyTransaction()
        {
            m_api = new Api(host, provider_key);

            Hashtable transactions = new Hashtable();
            Hashtable transaction = new Hashtable();
            transactions.Add("0", transaction);

            var ex = Assert.Throws<ApiException>( () => m_api.report(transactions));
            Assert.That(ex.Message, Is.EqualTo("Bad request"));
        }
开发者ID:blas-dmx,项目名称:3scale_ws_api_for_dotnet,代码行数:11,代码来源:ApiTest.cs

示例4: TestReportWithInvalidProviderKey

        public void TestReportWithInvalidProviderKey()
        {
            m_api = new Api(host, invalid_provider_key);

            Hashtable transactions = new Hashtable();
            Hashtable transaction = null;
            transaction = new Hashtable();
            transaction.Add("app_id", app_id);
            transaction.Add("app_key", app_key);

            Hashtable usage = new Hashtable();
            usage.Add("hits", "1");
            transaction.Add("usage", usage);
            transactions.Add("0", transaction);

            var ex = Assert.Throws<ApiException>(() => m_api.report(transactions) );
            Assert.That(ex.Message, Is.EqualTo("provider_key_invalid : provider key \"" + invalid_provider_key + "\" is invalid"));
        }
开发者ID:blas-dmx,项目名称:3scale_ws_api_for_dotnet,代码行数:18,代码来源:ApiTest.cs


注:本文中的IApi.report方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。