Files
ow-api/ovrstat_test.go
2019-12-23 21:47:48 -05:00

32 lines
574 B
Go

package main
import (
"encoding/json"
"s32x.com/ovrstat/ovrstat"
"testing"
)
func Test_Stats(t *testing.T) {
stats, err := ovrstat.PCStats("cats-11481")
if err != nil {
t.Fatal(err)
}
if stats.Private {
t.Fatal("Profile shouldn't be private")
}
if len(stats.QuickPlayStats.TopHeroes) == 0 {
t.Fatal("Expected more than zero top heroes")
}
if len(stats.QuickPlayStats.CareerStats) == 0 {
t.Fatal("Expected more than zero career stats")
} else {
b, _ := json.MarshalIndent(stats.QuickPlayStats.TopHeroes["ashe"], "", "\t")
t.Log(string(b))
}
}