更新时间:2022-02-25 22:16:26
作为@After
方法的替代方法,您也可以使用AutoCloseKoinTest
.
As an alternative to the @After
approach, you can also use AutoCloseKoinTest
. As described in the docs:
扩展的Koin测试-嵌入自动关闭@after方法以在每次测试后关闭Koin
Extended Koin Test - embed autoclose @after method to close Koin after every test
您可以扩展AutoCloseKoinTest
而不是扩展KoinTest
,它将为您做事后测试.
Instead of extending KoinTest
, you can extend AutoCloseKoinTest
and it will do the after test for you.