Copied to clipboard

Flag this post as spam?

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


  • Matt Whetton 19 posts 61 karma points
    Jan 31, 2014 @ 15:23
    Matt Whetton
    1

    Unit Testing Surface Controllers

    Is there any recognised way to unit test surface controllers and mock out any dependencies on things like UmbracoHelper, UmbraContext and ContentSurface?

    Thanks

    Matt

  • Charles Afford 1163 posts 1709 karma points
    Feb 01, 2014 @ 14:36
    Charles Afford
    0

    Sure, although its not an exact science at the moment, very much in development.  If you get the Umbraco zip and complie you will find a Umbraco.Test dll in the bin.  Refrence this dll in your unit testing project.

    See: http://stackoverflow.com/questions/17832096/unit-testing-a-rendermvccontroller-even-possible

    Charlie :)

  • Matt Whetton 19 posts 61 karma points
    Mar 17, 2014 @ 12:36
    Matt Whetton
    0

    Thanks Charlie - I finally got around to looking at this again but it looks like this method is only built to work with nunit - we're using mstest.

Please Sign in or register to post replies

Write your reply to:

Draft