commit inicial do projeto
This commit is contained in:
20
internal/oracle/fetcher_test.go
Normal file
20
internal/oracle/fetcher_test.go
Normal file
@ -0,0 +1,20 @@
|
||||
package oracle
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestFetchFromMock(t *testing.T) {
|
||||
d, err := FetchFromMock("USD-BRL")
|
||||
if err != nil {
|
||||
t.Fatalf("Erro ao buscar mock: %v", err)
|
||||
}
|
||||
if d.Key != "USD-BRL" || d.Value <= 0 {
|
||||
t.Errorf("Valor inesperado do mock: %+v", d)
|
||||
}
|
||||
|
||||
_, err = FetchFromMock("INVALIDO")
|
||||
if err == nil {
|
||||
t.Error("Esperado erro ao buscar chave inválida no mock")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user