mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-20 22:15:11 +00:00
First
This commit is contained in:
22
client/client_test.go
Normal file
22
client/client_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user