12345678910111213141516171819202122232425262728 |
- // rpc_test
- package rpc
- import (
- "log"
- "testing"
- )
- func Test_InCreadit(t *testing.T) {
- rc := new(RpcCall)
- rc.Addr = "127.0.0.1:8765"
- otherParam := make(map[string]interface{})
- otherParam["name"] = "zhangsan"
- otherParam["age"] = 18
- err := rc.InCreadit(&CreditData{Code: "1", Uid: "2", Num: 3, OtherParam: otherParam}, 0)
- log.Println("err:", err)
- }
- func Test_OutCreadit(t *testing.T) {
- rc := new(RpcCall)
- rc.Addr = "127.0.0.1:8765"
- otherParam := make(map[string]interface{})
- otherParam["name"] = "zhangsan"
- otherParam["age"] = 18
- replay := 0
- err := rc.OutCreadit(&CreditData{Code: "1", Uid: "2", Num: 3, OtherParam: otherParam}, &replay)
- log.Println("err:", err)
- }
|