mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
23 lines
416 B
Go
23 lines
416 B
Go
package client
|
|
|
|
import "testing"
|
|
|
|
type req struct {
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type rsp struct {
|
|
Msg string `json:"msg"`
|
|
}
|
|
|
|
func TestBasicCall(t *testing.T) {
|
|
response := rsp{}
|
|
if err := NewClient(nil).Call("go.micro.srv.greeter", "Say.Hello", req{Name: "John"}, &response); err != nil {
|
|
t.Fail()
|
|
}
|
|
if response.Msg != "Hello John" {
|
|
t.Logf("Message is not as expected: %v", response.Msg)
|
|
t.Fail()
|
|
}
|
|
}
|