Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jaffer 5 posts 85 karma points
    Jan 12, 2023 @ 11:15
    Jaffer
    0

    Hello Friends, I need to implement MOQ unit testing for my Umbraco 8 application. I have followed the Umbraco 8 unit testing documentation and implemented the same.

    We write our business logic code and API calls in controllers. To accessing the admin content we are using the generated models. Here my challenge is, not able to mock the generated model properties and Umbraco.Web.PublishedContentExtensions methods.

    I know the extension methods are static and we are not able to mock. Here my question is, Is it possible to mock the Umbraco 8 related objects. or Do we have any other solution to implement MOQ unit test cases for Umbraco 8 content?

    If you have any solution or sample code please share here.

Please Sign in or register to post replies

Write your reply to:

Draft