public void SetUp()
 {
     _nestedCollection = new NestedCollection(new List <HashSet <string> >
     {
         new HashSet <string> {
             "String1", "String2"
         },
         new HashSet <string> {
             "StringA", "StringB"
         }
     });
 }
示例#2
0
        private NestedCollection CreateDeepNested(int nestLevel)
        {
            var result = new NestedCollection();

            for (int i = 0; i < 10; i++)
            {
                var temp = result;
                for (int j = 0; j < nestLevel; j++)
                {
                    var inner = new NestedCollection();
                    temp.Children.Add(inner);
                    temp = inner;
                }
            }

            return(result);
        }
示例#3
0
        public bool ContainsFlatten()
        {
            var col = new NestedCollection();

            return(Collection.Flatten(x => x.Children).Any(x => ReferenceEquals(x, col)));
        }