Skip to content

Instantly share code, notes, and snippets.

Created November 6, 2020 13:42
What would you like to do?
Example of Unit Testing without SUT
func test_load_shouldRespondSomething() {
let analytic: Inalytic = AnalayticSpy()
let storageClient: IUserDefaults = UserDefaultsSpy()
let serviceClient: IHTTPClient = HTTPClientSpy()
let storage: TextToSpeechPreferencesStorage = TextToSpeechPreferencesStorageImpl(client: storageClient)
let service: TextToSpeechPreferencesService = TextToSpeechPreferencesServiceImpl(client: serviceClient)
let repository: TextToSpeechPreferencesRepository = TextToSpeechPreferencesRepositoryImpl(
storage: storage,
service: service
let useCase: LoadLanguageIdPreferencesUseCase = LoadLanguageIdPreferencesUseCaseImpl(
repository: repository,
analytic: analytic
// ...
// other code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment