32
Views
3
Comments
Solved
[Testing Framework] Possible to add mocking of service actions?
testing-framework
Reactive icon
Forge asset by Leonardo Fernandes
Application Type
Reactive

Hi,

Do you know if it is possible to also mock a call to a service action? 


Because we have some flows that include a service action in between that influences the rest of the flow. It would be quite the work to give every service action call a server action wrapper to be able to mock it.


Kind regards,

Bas

2019-07-08 11-04-35
Leonardo Fernandes
 
MVP
Solution

Hi Bas. You can use the MockServiceAction from version 3.0.0.

Let me know if you find any problems with it.

UserImage.jpg
Charles Du

Hi Leonardo, 

Borrowing this place I hope you can see my question. I am new in Outsystems and testingFramework, but I have some Moq testing experience in C#.

I have a Server Action (named "ProcessBoomiRequest") to test, and inside this action there are have two public server actions and one service action to run. 

Then I am creating MockAction and MockService for each respectively, and expecting to replace real ones during execution of testing ProcessBoomiRequest.

My questions:

1) am I on the right way to do the mock action/service testing?

2) how to config the input parameter and expected outputs for each? Seems like it is via MockContext, however I don't know how to do this?

If you can share me a link for some examples, it would be great!

Thank you in advance!

Kind Regards,

Charles


2023-04-19 18-38-51
Bas de Jong

Thank you so much! Trying it out tomorrow!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.