You'll want a schema for most of your tests.
There are several options:
- Using Builders
- Most of the tests in this repo has setup methods using builders
- Importing uSync files
- [TODO] Import your website usync files in one go
See the Creating_Content test for an example.
Most of the Umbraco services work out of the box with UmbracoIntegrationTest
.
All tests in this example repo use a database with schema per fixture.
A lot of Umbraco implementations utilize SurfaceController
to process form posts.
Very often they interact with the "current page".
The setup and extensions used in the CTA_Form
example is all you need to set up a "current page".
When that's done, you can use CurrentPage
, RedirectToCurrentPage
etc.
You'll want to test your editors with JSON from your client code.
The best way to fully test an editor is to inherit UmbracoTestServerTestBase
.
See the DataEditor_Via_Hosted_Controller
tests for an example.
Rendering is the slowest integration test you can do, but works "OOTB" with UmbracoTestServerTestBase
.
See the Rendring_Page_Via_Hosted_Url
tests for an example.