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); }
public void AddTo(ElephantCounter counter) { foreach (var node in _content) { node.AddTo(counter); } }