C++ – Unit testing Visitor pattern architecture

cdesign-patternsunit testingvisitor

I've introduced visitors as one of core architecture ideas in one of my apps. I have several visitors that operate on a same stuff. Now, how should I test it? Some tests I'm thinking of are a bit larger then a unit test should be (integration test? whatever) but I still wanna do it. How would you test code like the C++ sample from wiki art on Visitor Pattern

Best Answer

make a test visitor object and make it visit things.... test that it visited the right things.