public void TraverseTree_EmptyTree_ActionNotRun()
        {
            var mockAction = MockRepository.GenerateMock <TraverseFunc>();

            mockAction.Stub(x => x(null, null));
            var de = new DirEntry();

            de.TraverseTreePair(mockAction);

            mockAction.AssertWasNotCalled(x => x(null, null));
        }
        public void TraverseTree_SingleChildTree_CallsActionOnChild()
        {
            var de1 = new DirEntry(true)
            {
                Path = "d1", FullPath = "Mooo"
            };                                                               // only looks at Children for recurse.
            var de2 = new DirEntry {
                Path = "d2"
            };

            de1.Children.Add(de2);

            var mockAction = MockRepository.GenerateMock <TraverseFunc>();

            mockAction.Stub(x => x(de1, de2)).Return(true);

            de1.TraverseTreePair(mockAction);

            mockAction.AssertWasCalled(x => x(de1, de2));
        }