其思想是在程序的入口(main方法?) ,把与服务名对应的实例填充进服务定位器,单元测试的时候可以混合使用真实或模拟的实例来填充。
The idea is that in a boot-like place (the main method?) it is populated with appropriate instances for the service names, and that unit tests can program it with a mix of real and mock instances.
通过将一些逻辑从建议中分离到helper类中(或者方法中),可以编写与横切规范无关的、检查应用程序横切行为的测试。
By factoring some logic out of your advice and into a helper class (or method), you can write tests that check your application's crosscutting behavior independent of its crosscutting specification.
这种方法可以与第一种策略一起使用,也可以用来测试实际设备的驱动程序。
This approach could be used along with the first strategy and you can use this approach to test the driver with the actual target setup.
应用推荐