up_test.go 806 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package client
  2. import (
  3. "context"
  4. "testing"
  5. "time"
  6. "go-common/app/service/main/up/model"
  7. )
  8. func TestRpcClient(t *testing.T) {
  9. s := New(nil)
  10. time.Sleep(1 * time.Second)
  11. testInfo(t, s)
  12. testSpecial(t, s)
  13. testUpStatBase(t, s)
  14. testUpSwitch(t, s)
  15. }
  16. func testInfo(t *testing.T, s *Service) {
  17. arg := model.ArgInfo{
  18. Mid: 2089809,
  19. From: 1,
  20. }
  21. t.Log(s.Info(context.TODO(), &arg))
  22. }
  23. func testSpecial(t *testing.T, s *Service) {
  24. arg := model.ArgSpecial{
  25. GroupID: 1,
  26. }
  27. t.Log(s.Special(context.TODO(), &arg))
  28. }
  29. func testUpStatBase(t *testing.T, s *Service) {
  30. arg := model.ArgMidWithDate{
  31. Mid: 12345,
  32. }
  33. t.Log(s.UpStatBase(context.TODO(), &arg))
  34. }
  35. func testUpSwitch(t *testing.T, s *Service) {
  36. arg := model.ArgUpSwitch{
  37. Mid: 1,
  38. From: 0,
  39. }
  40. t.Log(s.UpSwitch(context.TODO(), &arg))
  41. }