would be clearer to have these tests each test one simple thing rather than effectively a big integration test, e.g. "When there are directories: It copies the directories", "When there are files: It copies the files", "When there are files: It copies the files: And when they contain the searchText: It replaces the searchText". Coding test-first would encourage this style. (the big advantage of this style is when a test fails it's clear which bit broke, and the coverage is normally better).