web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    RE: How to Write Unit Test cases for executeMultipleRequest using Microsoft Fakes

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

  • Sreeekanth Profile Picture
    95 on at
    RE: How to Write Unit Test cases for executeMultipleRequest using Microsoft Fakes

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

  • a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: How to Write Unit Test cases for executeMultipleRequest using Microsoft Fakes

    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
    RE: How to Write Unit Test cases for executeMultipleRequest using Microsoft Fakes

    Andrew Butenko Got it.  Thanks.

  • Suggested answer
    Daryl LaBar Profile Picture
    500 Most Valuable Professional on at
    RE: How to Write Unit Test cases for executeMultipleRequest using Microsoft Fakes

    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
    RE: How to Write Unit Test cases for executeMultipleRequest using Microsoft Fakes

    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
    RE: How to Write Unit Test cases for executeMultipleRequest using Microsoft Fakes

    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

Quick Links

Responsible AI policies

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

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 179

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 127 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans