コード例 #1
0
        public void QueryChildProcesses()
        {
            uint id = ProcessHelper.ByName("wininit.exe").Single().ProcessId.Value;
            IEnumerable <Win32Process> childProcesses = ProcessHelper.ChildProcesses(id);

            EnumerableAssert.Multiple(childProcesses);
        }
コード例 #2
0
        public void QueryByNameTest()
        {
            IEnumerable <Win32Process> processes = ProcessHelper.ByName("System Idle Process");

            EnumerableAssert.Single(processes);
            processes = ProcessHelper.ByName("svchost.exe");
            EnumerableAssert.Multiple(processes);
        }
コード例 #3
0
 public void QueryAllParentProcesses()
 {
     Win32Process[] processes = ProcessHelper.ByName("svchost.exe").ToArray();
     EnumerableAssert.Any(processes);
     processes.ForEach(process =>
     {
         IEnumerable <Win32Process> parentProcesses = ProcessHelper.AllParentProcess(process.ProcessId.Value);
         EnumerableAssert.Multiple(parentProcesses);
     });
 }
コード例 #4
0
 public void QueryParentProcess()
 {
     Win32Process[] processes = ProcessHelper.ByName("svchost.exe").ToArray();
     EnumerableAssert.Any(processes);
     processes.ForEach(process =>
     {
         Win32Process parentProcess = ProcessHelper.ParentProcess(process.ProcessId.Value);
         Assert.IsNotNull(parentProcess);
     });
 }
コード例 #5
0
        public void QueryAllChildProcesses()
        {
            uint id = ProcessHelper.ByName("wininit.exe").Single().ProcessId.Value;
            IEnumerable <Win32Process> tree = ProcessHelper.AllChildProcesses(id);

            EnumerableAssert.Multiple(tree);

            IEnumerable <Win32Process> childProcesses = ProcessHelper.ChildProcesses(id);

            Assert.IsTrue(tree.Count() > childProcesses.Count());
        }