Created
November 24, 2020 16:46
-
-
Save esilverberg/976f8824ea249f3791d31014f0a83a65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 🍎 Using Quick and Swinject | |
describe("MatchViewModelTests") { | |
var container: Container! | |
var logic: PSSMatchLogic! | |
var accountRepository: PSSAccountRepository! | |
var appEventLogger: PSSAppEventLogging! | |
var viewModel: PSSMatchViewModel! | |
beforeEach { | |
container = Container().injectEverythingForTests() | |
logic = container.resolve(PSSMatchLogic.self)! | |
accountRepository = container.resolve(PSSAccountRepository.self)! | |
appEventLogger = container.resolve(PSSAppEventLogging.self)! | |
viewModel = PSSMatchViewModel(logic: logic, appEventLogger: appEventLogger) | |
} | |
// 🤖 Using JUnit and Koin | |
@ExtendWith(AutoCloseKoinAfterEachExtension::class) | |
@TestInstance(TestInstance.Lifecycle.PER_METHOD) | |
class MatchViewModelTests: KoinTest { | |
private val accountRepository: AccountRepository by inject() | |
private val matchLogic: MatchLogic by inject() | |
private val appEventLogger: IAppEventLogger by inject() | |
private val matchApi: IMatchApi by inject() | |
private val matchViewModel: MatchViewModel by lazy { | |
MatchViewModel(matchLogic, appEventLogger) | |
} | |
@BeforeEach | |
fun setup() { | |
startKoin { | |
loadKoinModules(listOf(matchModule)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment