web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

How to Write Unit Test cases for executeMultipleRequest using Microsoft Fakes

(0) ShareShare
ReportReport
Posted on by 95

Hi Everyone,

I was using executeMultipleRequest to Execute multiple requests at the same time in my plugin. Now I just want to write my Unit test cases to cover my plugin code.

Did anyone worked on executeMultipleRequest in unit test Cases? 

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Daryl LaBar do you have it covered in your Unit Test framework?

  • Sreeekanth Profile Picture
    95 on at

    I should cover, I'm trying but getting error.

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Sreekanth, Daryl, who I referred in my reply created on of UnitTesting frameworks for Plugins so I asked him to join the thread and reply if he has covered it in his framework.

  • Sreeekanth Profile Picture
    95 on at

    Andrew Butenko Got it.  Thanks.

  • Suggested answer
    Daryl LaBar Profile Picture
    500 Most Valuable Professional on at

    Stop it.  Stop it right now.  Don't ever use MS Fakes for the IOrganizationService.  It's horrible.  

    Here is a video of me explaining how to do it for the RetrieveMultiple Request using fakes, and how to do it with FakeXrmEasy, and my framework XrmUnitTest.

    youtu.be/dRz1X6pdsk4

  • Sreeekanth Profile Picture
    95 on at

    Hi Daryl LaBar, I agree with you, but I can't use FakeXrmEasy. I should only use MS Fakes and there is no alternative for me.

    Anyhow thanks for your prompt reply.

    Kind regards,

    Sreekanth.

  • Verified answer
    Daryl LaBar Profile Picture
    500 Most Valuable Professional on at

    I'd argue with you on the "but I can't" part.

    That video I gave shows how to use MS Fakes to fake out the RetrieveMulitpleRequest, and you'd basically follow the same method for the executeMultipleRequest.  You'd have to Fake out the Execute, and then check for the request to be an ExecuteMultipleRequest, and have it return an ExeucteMultipleResponse.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Pallavi Phade Profile Picture

Pallavi Phade 98

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 81 Super User 2025 Season 2

#3
TAHER Mehdi Profile Picture

TAHER Mehdi 58

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans