示例#1
0
        public void TestNestedList2()
        {
            NestedList nlist = new NestedList();

            nlist.Add(new Nlist(1));

            var res1 = nlist.GetFinalValue();

            Console.WriteLine("res1 ={0}", res1);

            nlist.Add(new Nlist(new List <int> ()
            {
                4
            }));
            var res2 = nlist.GetFinalValue();

            Console.WriteLine("res2 ={0}", res2);

            var nlist2 = new Nlist(6);

            nlist.Add(new Nlist(nlist2));

            var res3 = nlist.GetFinalValue();

            Console.WriteLine("res3 ={0}", res3);

            Assert.AreEqual(res3, 27, "values are not equal");
        }
示例#2
0
 public Nlist(Nlist nlist)
 {
     _nestedList = nlist;
 }