mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-04 23:16:54 +00:00
* golangci-lint/CI: Bump versions
Fix remaining linter issues
* Specifically set AppVeyor version
* Fix the infamous typos 👀
* Add go env cmd to AppVeyor
* Add go version cmd to AppVeyor
* Specify AppVeyor image, adjust linters
* Update go get to go install due to deprecation
* Bump golangci-lint timeout time for AppVeyor
* Change NW contract to NQ
* Address nitters
* GetRandomPair -> Pair{}
* Address nits
* Address time nitterinos plus additional tweaks
* More time inception upgrades!
* Bending time and space
79 lines
1.6 KiB
Go
79 lines
1.6 KiB
Go
package fixer
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/thrasher-corp/gocryptotrader/currency/forexprovider/base"
|
|
)
|
|
|
|
// Please set API key and apikey subscription level for correct due diligence
|
|
// testing - NOTE please be aware tests will diminish your monthly API calls
|
|
|
|
const (
|
|
apikey = ""
|
|
apiKeyLvl = 3
|
|
)
|
|
|
|
var f Fixer
|
|
|
|
var isSetup bool
|
|
|
|
func setup(t *testing.T) {
|
|
t.Helper()
|
|
if !isSetup {
|
|
err := f.Setup(base.Settings{})
|
|
if err != nil {
|
|
t.Fatal("Setup error", err)
|
|
}
|
|
isSetup = true
|
|
}
|
|
}
|
|
|
|
func TestGetRates(t *testing.T) {
|
|
setup(t)
|
|
_, err := f.GetRates("EUR", "AUD")
|
|
if err == nil {
|
|
t.Error("fixer GetRates() Expected error")
|
|
}
|
|
}
|
|
|
|
func TestGetLatestRates(t *testing.T) {
|
|
setup(t)
|
|
_, err := f.GetLatestRates("EUR", "AUD")
|
|
if err == nil {
|
|
t.Error("fixer GetLatestRates() Expected error")
|
|
}
|
|
}
|
|
|
|
func TestGetHistoricalRates(t *testing.T) {
|
|
setup(t)
|
|
_, err := f.GetHistoricalRates("2013-12-24", "EUR", []string{"AUD,KRW"})
|
|
if err == nil {
|
|
t.Error("fixer GetHistoricalRates() Expected error")
|
|
}
|
|
}
|
|
|
|
func TestConvertCurrency(t *testing.T) {
|
|
setup(t)
|
|
_, err := f.ConvertCurrency("AUD", "EUR", "", 1337)
|
|
if err == nil {
|
|
t.Error("fixer ConvertCurrency() Expected error")
|
|
}
|
|
}
|
|
|
|
func TestGetTimeSeriesData(t *testing.T) {
|
|
setup(t)
|
|
_, err := f.GetTimeSeriesData("2013-12-24", "2013-12-25", "EUR", []string{"AUD,KRW"})
|
|
if err == nil {
|
|
t.Error("fixer GetTimeSeriesData() Expected error")
|
|
}
|
|
}
|
|
|
|
func TestGetFluctuationData(t *testing.T) {
|
|
setup(t)
|
|
_, err := f.GetFluctuationData("2013-12-24", "2013-12-25", "EUR", []string{"AUD,KRW"})
|
|
if err == nil {
|
|
t.Error("fixer GetFluctuationData() Expected error")
|
|
}
|
|
}
|