You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
806 B
48 lines
806 B
package client |
|
|
|
import ( |
|
"context" |
|
"testing" |
|
"time" |
|
|
|
"go-common/app/service/main/up/model" |
|
) |
|
|
|
func TestRpcClient(t *testing.T) { |
|
s := New(nil) |
|
time.Sleep(1 * time.Second) |
|
testInfo(t, s) |
|
testSpecial(t, s) |
|
testUpStatBase(t, s) |
|
testUpSwitch(t, s) |
|
} |
|
|
|
func testInfo(t *testing.T, s *Service) { |
|
arg := model.ArgInfo{ |
|
Mid: 2089809, |
|
From: 1, |
|
} |
|
t.Log(s.Info(context.TODO(), &arg)) |
|
} |
|
|
|
func testSpecial(t *testing.T, s *Service) { |
|
arg := model.ArgSpecial{ |
|
GroupID: 1, |
|
} |
|
t.Log(s.Special(context.TODO(), &arg)) |
|
} |
|
|
|
func testUpStatBase(t *testing.T, s *Service) { |
|
arg := model.ArgMidWithDate{ |
|
Mid: 12345, |
|
} |
|
t.Log(s.UpStatBase(context.TODO(), &arg)) |
|
} |
|
|
|
func testUpSwitch(t *testing.T, s *Service) { |
|
arg := model.ArgUpSwitch{ |
|
Mid: 1, |
|
From: 0, |
|
} |
|
t.Log(s.UpSwitch(context.TODO(), &arg)) |
|
}
|
|
|