Repository navigation
Refactor weather tests to use setup function - #62
Open
teobaldotech wants to merge 1 commit into
Open
teobaldotech wants to merge 1 commit into
teobaldotech wants to merge 1 commit into
Conversation
O código é uma suíte de testes em Go para validar o comportamento do endpoint responsável por consultar o clima atual de uma cidade. Ele utiliza testing, httptest, encoding/json e gorilla/mux. A principal melhoria foi aplicar o princípio F.I.R.S.T., tornando os testes mais rápidos, independentes, repetíveis, autovalidáveis e escritos de forma próxima ao comportamento que precisam verificar.
Author
|
Os testes foram revisados e estruturados seguindo o princípio F.I.R.S.T., proporcionando uma suíte mais rápida, independente, repetível, autovalidável e alinhada ao comportamento do endpoint. A criação do router foi centralizada para reduzir duplicação, os testes utilizam httptest para evitar dependências de um servidor HTTP real e foram adicionados cenários para sucesso, cidade não encontrada, método HTTP não permitido e rota inexistente. |
Comment on lines
+65
to
+66
| // TestNotFoundWeather verifica se uma cidade inexistente | ||
| // retorna HTTP 404. |
Owner
There was a problem hiding this comment.
Just trying to keep the codebase in english
Suggested change
| // TestNotFoundWeather verifica se uma cidade inexistente | |
| // retorna HTTP 404. | |
| // TestNotFoundWeather check if not found city returns 404 |
Comment on lines
+91
to
+92
| // TestCurrentWeatherMethodNotAllowed verifica se métodos | ||
| // diferentes de GET são rejeitados. |
Owner
There was a problem hiding this comment.
Suggested change
| // TestCurrentWeatherMethodNotAllowed verifica se métodos | |
| // diferentes de GET são rejeitados. | |
| // TestCurrentWeatherMethodNotAllowed check if methods other than GET are rejected. |
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
O código é uma suíte de testes em Go para validar o comportamento do endpoint responsável por consultar o clima atual de uma cidade. Ele utiliza testing, httptest, encoding/json e gorilla/mux.
A principal melhoria foi aplicar o princípio F.I.R.S.T., tornando os testes mais rápidos, independentes, repetíveis, autovalidáveis e escritos de forma próxima ao comportamento que precisam verificar.