Typhoon: How to get an instance conforming to a protocol for production, and another for tests?
问题 I've defined an ApplicationAssembly in Typhoon. So what I want to do is say: "This class X needs to be injected with something conforming to the Foo protocol. This is a RealFoo, this is a TestFoo. When I'm running X in real life, I want it to get a RealFoo, but when I'm running my integration tests, I want it to get a TestFoo". How can I do this? 回答1: There are several recommended ways to do this: Use the Typhoon Patcher Typhoon-patcher allows loading a base assembly, but with one or more