Files
m3o-go/client/client_test.go
Asim Aslam 5a96bf5ef0 First
2020-07-23 23:03:27 +01:00

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()
}
}