Esempio n. 1
0
        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");
        }
Esempio n. 2
0
 /// <summary>
 /// Get the child processes by name
 /// </summary>
 public static ProcessId GetChild(this ProcessId self, ProcessName name) =>
 self.Child(name);