mardi 1 décembre 2015

Go Lang How to Mock Package Method?

I have a method that uses an package method dao.ToVendorId, how can i mock it??

func group(context context.Execution, dataStore dataStore) (map[string][]VendorItem, map[string]string, error) {

for _,info := range dataStore.Items {
    if itemId, err := dao.ToVendorId(context, info.Seller, info.Id); err != nil {
        return vendorItems, vendorDataTranslated, err
    } else {
  //More Code
    }
}
return vendorItems, vendorDataTranslated, nil;

}

Aucun commentaire:

Enregistrer un commentaire