示例#1
0
        public void Whatever_Anything()
        {
            //GIVEN
            var box = new Box(
                new Box(
                    new Elephant()
                    ),
                new Box(
                    new Box(
                        new Elephant(),
                        new Elephant(),
                        new Melon(),
                        new Elephant()
                        ),
                    new Elephant()
                    )
                );
            var elephantCounter = new ElephantCounter();

            //WHEN
            box.AddTo(elephantCounter);
            var count = elephantCounter.Value();

            //THEN
            count.Should().Be(5);
        }
示例#2
0
 public void AddTo(ElephantCounter counter)
 {
     foreach (var node in _content)
     {
         node.AddTo(counter);
     }
 }