Open amadeu01 opened 6 years ago
Vc tem que testar, dada todas as possibilidades, se as URLs são montadas corretamente. Por exemplo:
final class SearchEndpointTests: XCTestCase {
// test <Method or Property> when <Condition> then <Expected>
func testPathWhenFetchThenReturnSearchPath() {
// Arrange
let fetch = Endpoints.Search.fetch
// Act
let path = fetch.path
// Assert
XCTAssertEqual(path, "/search/")
}
}
@amadeu01 atualizei meu comentário acima. Eu tinha feito um comentário errado no código.
Beleza!
Não sei como seria a forma mais adequada de testar e o que devo testar.
https://github.com/amadeu01/the-movie-db-client/blob/df6cec47ddc1b43b6eb7252b535c6b51b23af3ce/The%20Movie%20DB%20Client/Common/Endpoint.swift#L23
https://github.com/amadeu01/the-movie-db-client/blob/df6cec47ddc1b43b6eb7252b535c6b51b23af3ce/The%20Movie%20DB%20Client/Common/Endpoint.swift#L28
Devo testar se a url que é retornada nessa estrutura bate com a URL esperada?