public void GetProcesses()
        {
            var processes = ProcessExtensions.GetProcesses();

            var currentProcess = Process.GetCurrentProcess();

            Assert.True(processes.Any(p => p.ProcessId == currentProcess.Id), "Current process is not in the list of processes");
            AssertExtensions.AllItemsAreUnique(processes.ToList());
        }
        public void GetAncestorProcessIds()
        {
            var current = Process.GetCurrentProcess();
            var parents = current.GetAncestorProcessIds().ToList();

            AssertExtensions.AllItemsAreUnique(parents);
            bool hasParent = false;

            foreach (var parentId in parents)
            {
                try
                {
                    var parent = Process.GetProcessById(parentId);
                    hasParent = true;
                    Assert.True(parent.GetDescendantProcesses().Any(p => p.Id == current.Id), "Parent process must have the current process as descendant");
                }
                catch (ArgumentException)
                {
                }
            }

            Assert.True(hasParent, "The process has no parents");
        }