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.Printf("--> %v", listResp.GetCurrencyCodes())
log.Println("--- rpc Convert()") log.Println("--- rpc Convert()")
convertResp, err := cl.Convert(context.TODO(), &pb.CurrencyConversionRequest{ in := &pb.Money{
From: &pb.Money{
CurrencyCode: "CAD", CurrencyCode: "CAD",
Amount: &pb.MoneyAmount{ Amount: &pb.MoneyAmount{
Decimal: 12, Decimal: 12,
Fractional: 25}, Fractional: 25},
}, }
convertResp, err := cl.Convert(context.TODO(), &pb.CurrencyConversionRequest{
From: in,
ToCode: "USD"}) ToCode: "USD"})
if err != nil { if err != nil {
return err return err
} }
log.Printf("--> result: %+v", convertResp) log.Printf("--> in=%v result(USD): %+v", in, convertResp)
return nil return nil
} }