Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathPerfDataUnitTest.cs
More file actions
Latest commit
39 lines (33 loc) · 1.49 KB
/
Copy pathPerfDataUnitTest.cs
File metadata and controls
39 lines (33 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
usingMicrosoft.Performance.Toolkit.Engine;
usingMicrosoft.Performance.Toolkit.Plugins.PerfDataExtension;
usingMicrosoft.VisualStudio.TestTools.UnitTesting;
usingSystem.IO;
usingAssembly=System.Reflection.Assembly;
namespacePerfDataUnitTest
{
[TestClass]
publicclassPerfDataUnitTest
{
[TestMethod]
publicvoidProcessPerfGenericEvents()
{
// Input data
varinputPath=Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
varperfDataPath=Path.Combine(inputPath,"TestData\\perf.data");
Assert.IsTrue(File.Exists(perfDataPath));
varpluginPath=Path.GetDirectoryName(typeof(PerfDataProcessingSource).Assembly.Location);
usingvarplugins=PluginSet.Load(pluginPath);
usingvardataSources=DataSourceSet.Create(plugins);
dataSources.AddFile(perfDataPath);
varcreateInfo=newEngineCreateInfo(dataSources.AsReadOnly());
usingvarengine=Engine.Create(createInfo);
engine.EnableCooker(PerfDataGenericSourceCooker.DataCookerPath);
engine.EnableTable(PerfDataGenericEventsTable.TableDescriptor);
varresults=engine.Process();
vartable=results.BuildTable(PerfDataGenericEventsTable.TableDescriptor);
Assert.AreEqual(1003,table.RowCount);
}
}
}