本文整理汇总了C#中NUnit.Framework.Count方法的典型用法代码示例。如果您正苦于以下问题:C# NUnit.Framework.Count方法的具体用法?C# NUnit.Framework.Count怎么用?C# NUnit.Framework.Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NUnit.Framework
的用法示例。
在下文中一共展示了NUnit.Framework.Count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestConcurrentAccess
public void TestConcurrentAccess() {
var sourceFiles1 = new[]
{
[email protected]"\xyzzy\Example.cs",
[email protected]"\foo\bar\MissingFile.cs",
[email protected]"\zork\Example.cs",
[email protected]"\path\to\file\data.cpp",
[email protected]"\path\to\file\data1.cpp",
[email protected]"\path\to\file\data2.cpp",
[email protected]"\path\to\file\data3.cpp",
[email protected]"\path\to\file\data4.cpp",
[email protected]"\path\to\file\data5.cpp",
[email protected]"\path\to\file\data6.cpp",
[email protected]"\path\to\file\data7.cpp",
[email protected]"\path\to\file\data8.cpp",
[email protected]"\path\to\file\data9.cpp",
[email protected]"\path\to\file\data10.cpp",
[email protected]"\path\to\file\data11.c"
};
var sourceFiles2 = new[]
{
[email protected]"\foo\bar\Example.cs",
[email protected]"\path\to\file\data.cpp",
[email protected]"\path\to\file\data1.cpp",
[email protected]"\path\to\file\data2.cpp",
[email protected]"\foo\bar\ImportantData.cpp",
[email protected]"\path\to\file\data3.cpp",
[email protected]"\path\to\file\data4.cpp",
[email protected]"\path\to\file\data5.cpp",
[email protected]"\path\to\file\data6.cpp",
[email protected]"\path\to\file\data7.cpp",
[email protected]"\path\to\file\data8.cpp",
[email protected]"\path\to\file\data9.cpp",
[email protected]"\other\dir\Sample.h",
[email protected]"\path\to\file\data10.cpp",
[email protected]"\path\to\file\data11.c"
};
var xmlFiles = new[]
{
[email protected]"\mappingTest\Example.cs.1.xml",
[email protected]"\mappingTest\MissingFile.cs.1.xml",
[email protected]"\mappingTest\Example.cs.2.xml",
[email protected]"\mappingTest\data.cpp.1.xml",
[email protected]"\mappingTest\data1.cpp.1.xml",
[email protected]"\mappingTest\data2.cpp.1.xml",
[email protected]"\mappingTest\data3.cpp.1.xml",
[email protected]"\mappingTest\data4.cpp.1.xml",
[email protected]"\mappingTest\data5.cpp.1.xml",
[email protected]"\mappingTest\data6.cpp.1.xml",
[email protected]"\mappingTest\data7.cpp.1.xml",
[email protected]"\mappingTest\data8.cpp.1.xml",
[email protected]"\mappingTest\data9.cpp.1.xml",
[email protected]"\mappingTest\data10.cpp.1.xml",
[email protected]"\mappingTest\data11.c.1.xml",
[email protected]"\mappingTest\Example.cs.3.xml",
[email protected]"\mappingTest\ImportantData.cpp.1.xml",
[email protected]"\mappingTest\Sample.h.1.xml",
};
var map = new SrcMLFileNameMapping("mappingTest");
var worker = new Thread(() => ConcurrentWorker(map, sourceFiles2));
worker.Start();
foreach(var file in sourceFiles1) {
map.GetTargetPath(file);
}
worker.Join(5000);
map.SaveMapping();
var obsSourceFiles = new HashSet<string>();
var obsXmlFiles = new HashSet<string>();
foreach(var entry in File.ReadAllLines("mappingTest\\mapping.txt")) {
var fields = entry.Split('|');
obsSourceFiles.Add(fields[0]);
obsXmlFiles.Add(fields[1]);
}
var sourceFiles = sourceFiles1.Union(sourceFiles2);
Assert.AreEqual(sourceFiles.Count(), obsSourceFiles.Count);
Assert.AreEqual(xmlFiles.Count(), obsXmlFiles.Count);
foreach(var file in obsSourceFiles) {
Assert.IsTrue(sourceFiles.Contains(file));
}
foreach(var file in obsXmlFiles) {
Assert.IsTrue(xmlFiles.Contains(file));
}
}