public void ProcessIdTest() { ProcessId pid = "/root/user/test"; Assert.True(pid.Path == "/root/user/test"); Assert.True(pid.Name.Value == "test"); Assert.True(pid.Child("ing").Path == "/root/user/test/ing"); var json = JsonConvert.SerializeObject(pid); pid = JsonConvert.DeserializeObject <ProcessId>(json); Assert.True(pid.Path == "/root/user/test"); Assert.True(pid.Name.Value == "test"); Assert.True(pid.Child("ing").Path == "/root/user/test/ing"); }
/// <summary> /// Get the child processes by name /// </summary> public static ProcessId GetChild(this ProcessId self, ProcessName name) => self.Child(name);