本文整理汇总了C#中Keen.Core.KeenClient.GetQueries方法的典型用法代码示例。如果您正苦于以下问题:C# KeenClient.GetQueries方法的具体用法?C# KeenClient.GetQueries怎么用?C# KeenClient.GetQueries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Keen.Core.KeenClient
的用法示例。
在下文中一共展示了KeenClient.GetQueries方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AvailableQueries_Success
public async void AvailableQueries_Success()
{
var client = new KeenClient(settingsEnv);
Mock<IQueries> queryMock = null;
if (UseMocks)
{
// A few values that should be present and are unlikely to change
IEnumerable<KeyValuePair<string,string>> testResult = new List<KeyValuePair<string, string>>()
{
new KeyValuePair<string, string>("minimum", "url" ),
new KeyValuePair<string, string>("average", "url" ),
new KeyValuePair<string, string>("maximum", "url" ),
new KeyValuePair<string, string>("count_url", "url" ),
};
queryMock = new Mock<IQueries>();
queryMock.Setup(m=>m.AvailableQueries())
.Returns(Task.FromResult(testResult));
client.Queries = queryMock.Object;
}
var response = await client.GetQueries();
Assert.True(response.Any(p => p.Key == "minimum"));
Assert.True(response.Any(p => p.Key == "average"));
Assert.True(response.Any(p => p.Key == "maximum"));
Assert.True(response.Any(p => p.Key == "count_url"));
if (null != queryMock)
queryMock.Verify(m => m.AvailableQueries());
}