public void LoadsNestedActivities()
        {
            var parser = new ActivityParser();

            parser.AddXml(Xml1);
            parser.AddXml(Xml2);
            parser.AddXml(Xml3);
            parser.AddXml(Xml4);
            var actual = parser.TopLevelActivities().ToList();

            Assert.Collection(actual, a =>
            {
                Assert.Equal("|85239d86-498cf83c8feb6846.", a.Id);
                Assert.Collection(a.Children, c =>
                {
                    Assert.Equal("|85239d86-498cf83c8feb6846.1.", c.Id);
                    Assert.Equal(a, c.Parent);
                });
            });
        }
示例#2
0
        private static async Task <Activity[]> Activities(string directory)
        {
            var files       = new Files().Find(directory).ToArray();
            var entryParser = new ActivityParser();

            foreach (var fileTask in new FileReader().ReadAll(files))
            {
                entryParser.AddXml(await fileTask);
            }
            return(entryParser.TopLevelActivities().ToArray());
        }