BDD/TDD: can dependencies be a behavior?
问题 I've been told not to use implementation details. A dependency seems like an implementation detail. However I could phrase it also as a behavior. Example: A LinkList depends on a storage engine to store its links (eg LinkStorageInterface). The constructor needs to be passed an instance of an implemented LinkStorageInterface to do its job. I can't say 'shouldUseLinkStorage'. But maybe I can say 'shouldStoreLinksInStorage'. What is correct to 'test' in this case? Should I test that it stores