本文整理汇总了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"));
}
示例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"));
}
示例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"));
}
示例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"));
}