IEnumerable <string> GetNames(CmdStream s) { foreach (Cmd c in s.Cmds.Where(x => x.Data.CmdName == "NameCmdLine")) { yield return(c.Data.GetValue <string>("Name")); } }
void CheckNames(CmdStream stream, string[] expect) { var actual = GetNames(stream).ToArray(); Assert.AreEqual <int>(expect.Length, actual.Length); for (int i = 0; i < actual.Length; i++) { Assert.AreEqual <string>(expect[i], actual[i]); } }