本文整理汇总了C#中Microsoft.VisualStudio.TestPlatform.UnitTestFramework.Select方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.VisualStudio.TestPlatform.UnitTestFramework.Select方法的具体用法?C# Microsoft.VisualStudio.TestPlatform.UnitTestFramework.Select怎么用?C# Microsoft.VisualStudio.TestPlatform.UnitTestFramework.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.VisualStudio.TestPlatform.UnitTestFramework
的用法示例。
在下文中一共展示了Microsoft.VisualStudio.TestPlatform.UnitTestFramework.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AsyncStorageModule_GetAllKeys_SpecialCharacters
public void AsyncStorageModule_GetAllKeys_SpecialCharacters()
{
var module = new AsyncStorageModule();
var waitHandle = new AutoResetEvent(false);
var error = default(JObject);
var result = default(JArray);
var callback = new MockCallback(res =>
{
error = res.Length > 0 ? (JObject)res[0] : null;
result = res.Length > 1 ? (JArray)res[1] : null;
waitHandle.Set();
});
module.clear(callback);
Assert.IsTrue(waitHandle.WaitOne());
Assert.IsNull(error);
Assert.IsNull(result);
var pairs = new[]
{
new[] { "\\", "1" },
new[] { "/", "2" },
new[] { ":", "3" },
new[] { "*", "4" },
new[] { "?", "5" },
new[] { "<", "6" },
new[] { ">", "7" },
new[] { "|", "8" },
new[] { "\"", "9" },
new[] { ".", "10" },
new[] { "{", "11" },
new[] { "}", "12" },
new[] { "\\/:*?<>|\".{}", "13" },
new[] { "abc\\abc/abc:abc*abc?abc<abc>abc|abc\"abc.abc{abc}abc", "13" },
new[] { "foo:bar", "14" },
};
module.multiSet(pairs, callback);
Assert.IsTrue(waitHandle.WaitOne());
Assert.IsNull(error);
Assert.IsNull(result);
module.getAllKeys(callback);
Assert.IsTrue(waitHandle.WaitOne());
Assert.IsNull(error);
var expectedKeys = pairs.Select(arr => arr[0]).OrderBy(s => s);
var actualKeys = result.ToObject<string[]>().OrderBy(s => s);
Assert.IsTrue(expectedKeys.SequenceEqual(actualKeys));
}