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.
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?
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
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
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
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/
is working on a reply...