Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to write some integration tests for my event handlers. I've added the integration testing nuget package to my project and set everything up as described in the documentation (https://docs.umbraco.com/umbraco-cms/implementation/integration-testing).
The issue is whenever I try and get IPublishedContentQuery (either through GetRequiredService or through another dependency's constructor) an exception is thrown: "System.InvalidOperationException : Wasn't able to get an UmbracoContext".
IPublishedContentQuery
GetRequiredService
What am I missing? Thanks!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Injecting IPublishedContentQuery during an integration test throws an exception
I'm trying to write some integration tests for my event handlers. I've added the integration testing nuget package to my project and set everything up as described in the documentation (https://docs.umbraco.com/umbraco-cms/implementation/integration-testing).
The issue is whenever I try and get
IPublishedContentQuery
(either throughGetRequiredService
or through another dependency's constructor) an exception is thrown: "System.InvalidOperationException : Wasn't able to get an UmbracoContext".What am I missing? Thanks!
is working on a reply...