package model

import (
	"fmt"
	"testing"

	"gordenko.dev/dima/qx"

	_ "github.com/go-sql-driver/mysql"
)

func TestListStrategyCHampStats(t *testing.T) {
	db, err := qx.Open("mysql", "user:password@/tipper")
	if err != nil {
		panic(err)
	}
	defer db.Close()

	m := New(db)

	list, err := m.ListStrategyChampStats(1)
	if err != nil {
		t.Fatal(err)
	}

	for _, item := range list {
		fmt.Printf("%.2f%% %d - %d\n", getAccuracy(item.Won, item.Lost), item.Won, item.Lost)
	}
}
