MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin / TestCalculateNewRate

Function TestCalculateNewRate

plugin/chess/elo_test.go:8–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func TestCalculateNewRate(t *testing.T) {
9 type args struct {
10 whiteRate int
11 blackRate int
12 whiteScore float64
13 blackScore float64
14 }
15 tests := []struct {
16 name string
17 args args
18 want int
19 want1 int
20 }{
21 {
22 name: "test1",
23 args: args{
24 whiteRate: 1613,
25 blackRate: 1573,
26 whiteScore: 0.5,
27 blackScore: 0.5,
28 },
29 want: 1611,
30 want1: 1575,
31 },
32 }
33 for _, tt := range tests {
34 t.Run(tt.name, func(t *testing.T) {
35 got, got1 := calculateNewRate(tt.args.whiteRate, tt.args.blackRate, tt.args.whiteScore, tt.args.blackScore)
36 if got != tt.want {
37 t.Errorf("CalculateNewRate() got = %v, want %v", got, tt.want)
38 }
39 if got1 != tt.want1 {
40 t.Errorf("CalculateNewRate() got1 = %v, want %v", got1, tt.want1)
41 }
42 })
43 }
44}
45
46func Test_calculateException(t *testing.T) {
47 type args struct {

Callers

nothing calls this directly

Calls 1

calculateNewRateFunction · 0.85

Tested by

no test coverage detected