Mock Google Ads API request

866 views
Skip to first unread message

Javier Val

unread,
Mar 16, 2022, 10:02:01 AM3/16/22
to Google Ads API and AdWords API Forum
Hello everyone, 

When implementing our integration tests, there is a number of cases when we don't want to send real API requests. Instead we only want to imitate such sending. 

We are using the Google Ads .NET client, do you know a way to mock this behavior? Any tool, package or implementation?

Thanks for your help

Regards

Zweitze

unread,
Mar 16, 2022, 12:36:19 PM3/16/22
to Google Ads API and AdWords API Forum
Take a look at the Google Ads .NET client package sources. These sources have themselves unit tests, and some utilities - for instance, mock an error.

Google Ads API Forum Advisor

unread,
Mar 17, 2022, 2:07:05 AM3/17/22
to zwe...@gmail.com, adwor...@googlegroups.com
Hi Javier,

Thanks for reaching out.

Thank you also Zweitze for your recommendations.

In addition to that, when testing out the various features of the API, you can opt to use test accounts , and also the validate_only feature for services that support it (ex. validate_only of the CampaignService).

Let us know if you have any questions.

Best regards,
Google Logo
Heidi
Google Ads API Team
 


ref:_00D1U1174p._5004Q2YlspV:ref

Javier Val

unread,
Mar 17, 2022, 3:44:26 AM3/17/22
to Google Ads API and AdWords API Forum
Thank you both very much for your answers.

For our unit tests we will rely on the Google Ads .NET client package sources, as Zweitze suggests. And for our integration tests I think using test accounts and validate_only is a very good solution.

Thanks for your help.
Regards

Google Ads API Forum Advisor

unread,
Mar 17, 2022, 5:13:25 AM3/17/22
to javie...@tiendeo.com, adwor...@googlegroups.com
Hi Javier,

If you have additional questions regarding the topic being discussed in this thread, feel free to send those over to our team and we would be happy to assist you further.

Ngon Nguyen

unread,
Mar 17, 2022, 8:13:22 PM3/17/22
to javie...@tiendeo.com, Google Ads API and AdWords API Forum
Chào mừng bạn đến với bảng nhớ tạm của Gboard, bất kỳ văn bản nào bạn sao chép sẽ được lưu tại đây.Sử dụng biểu tượng chỉnh sửa để ghim, thêm hoặc xóa đoạn.Nhấn vào một đoạn để dán vào hộp văn bản.Chạm và giữ một đoạn để ghim đoạn đó. Các đoạn đã bỏ ghim sẽ bị xóa sau 1 giờ.

Vào 21:02, Th 4, 16 thg 3, 2022 Javier Val <javie...@tiendeo.com> đã viết:
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/c3fe2d4c-b120-48ba-99ba-9c15b60c125bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages