Copied to clipboard

Flag this post as spam?

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


  • Nathan Woulfe 447 posts 1665 karma points MVP 5x hq c-trib
    Mar 16, 2018 @ 06:16
    Nathan Woulfe
    0

    Integration testing - how to?

    Time has come to write some integration tests - things like checking custom services do what they should, and can get/post data into custom tables.

    Have read 1,539 blog posts, and am currently looking at a project with NUnit and Moq.

    No worries running simple unit tests of my code, but I want access to the Umbraco db as well, to actually perform transactions.

    How do I make this work?

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Mar 16, 2018 @ 07:11
    Dave Woestenborghs
    0

    Hi Nathan,

    You problably read Lars-Erik Aabech's blogs already.

    But he shared some materials online as wel : https://bitbucket.org/bleedo/umbraco-testing-workshop-h2-2017/src/?at=workshop-start

    dave

  • Nathan Woulfe 447 posts 1665 karma points MVP 5x hq c-trib
    Mar 16, 2018 @ 07:26
    Nathan Woulfe
    0

    Yup, been reading a lot today!

    Hadn't seen that repo though, will have a dig.

    Other option I've been tossing around was creating a database before starting the tests (CE or sqllite in memory), seeding it with basic data and testing against that. There's only a couple of touch points with Umbraco that I'd need to be testing, and can probably just mock those.

    All pretty new to me still

  • Dave Woestenborghs 3504 posts 12135 karma points MVP 9x admin c-trib
    Mar 16, 2018 @ 07:27
    Dave Woestenborghs
    0

    I have been doing that as well in a unit test for NHibernate based project.

    It creates a SQL LocalDB when the unit tests run and deletes it when finished.

    Dave

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Mar 22, 2018 @ 01:06
    Aaron Powell
    0

    I just wrote some tooling and a blog post on how to do it: https://www.aaron-powell.com/posts/2018-03-22-integration-testing-umbraco-with-chauffeur/

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies