Esempio n. 1
0
func TestEchoClient(t *testing.T) {
	if testing.Short() {
		t.Skip()
		return
	}

	cl := echo.NewEchoServiceApiWithBasePath("http://localhost:8080")
	resp, err := cl.Echo("foo")
	if err != nil {
		t.Errorf(`cl.Echo("foo") failed with %v; want success`, err)
	}
	if got, want := resp.Id, "foo"; got != want {
		t.Errorf("resp.Id = %q; want %q", got, want)
	}
}
Esempio n. 2
0
func TestEchoBodyClient(t *testing.T) {
	if testing.Short() {
		t.Skip()
		return
	}

	cl := echo.NewEchoServiceApiWithBasePath("http://localhost:8080")
	req := echo.ExamplepbSimpleMessage{Id: "foo"}
	resp, err := cl.EchoBody(req)
	if err != nil {
		t.Errorf("cl.EchoBody(%#v) failed with %v; want success", req, err)
	}
	if got, want := resp.Id, "foo"; got != want {
		t.Errorf("resp.Id = %q; want %q", got, want)
	}
}