Example of Unit Testing without SUT
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
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 | |
XCTAssertNotNil(useCase) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment