test-cli: refactor currencyservice smoke test

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
This commit is contained in:
Ahmet Alp Balkan 2018-06-21 22:34:17 -07:00
parent 1c00f04e1e
commit 5b3530c021

View file

@ -270,17 +270,18 @@ func testCurrencyService() error {
log.Printf("--> %v", listResp.GetCurrencyCodes())
log.Println("--- rpc Convert()")
convertResp, err := cl.Convert(context.TODO(), &pb.CurrencyConversionRequest{
From: &pb.Money{
in := &pb.Money{
CurrencyCode: "CAD",
Amount: &pb.MoneyAmount{
Decimal: 12,
Fractional: 25},
},
}
convertResp, err := cl.Convert(context.TODO(), &pb.CurrencyConversionRequest{
From: in,
ToCode: "USD"})
if err != nil {
return err
}
log.Printf("--> result: %+v", convertResp)
log.Printf("--> in=%v result(USD): %+v", in, convertResp)
return nil
}