pendant_test.go 917 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package server
  2. import (
  3. "go-common/app/service/main/usersuit/model"
  4. "testing"
  5. )
  6. const (
  7. _pendantEquip = "RPC.Equipment"
  8. _pendantEquips = "RPC.Equipments"
  9. )
  10. // TestRPC_Equipment test
  11. func TestRPC_Equipment(t *testing.T) {
  12. var (
  13. res = new(model.PendantEquip)
  14. err error
  15. )
  16. once.Do(startServer)
  17. arg := &model.ArgEquipment{
  18. Mid: 27515240,
  19. }
  20. if err = client.Call(_pendantEquip, arg.Mid, &res); err != nil {
  21. t.Errorf("client.Call(%s) error(%v)", _pendantEquip, err)
  22. t.FailNow()
  23. }
  24. t.Logf("res (%v)", res)
  25. }
  26. // TestRPC_Equipment test
  27. func TestRPC_Equipments(t *testing.T) {
  28. var (
  29. res = make(map[int64]*model.PendantEquip)
  30. err error
  31. )
  32. once.Do(startServer)
  33. arg := &model.ArgEquipments{
  34. Mids: []int64{27515240, 100},
  35. }
  36. if err = client.Call(_pendantEquips, arg.Mids, &res); err != nil {
  37. t.Errorf("client.Call(%s) error(%v)", _pendantEquips, err)
  38. t.FailNow()
  39. }
  40. t.Logf("res (%v)", res)
  41. }