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 am just starting with unit test my code. This article i used to setup my base: https://skrift.io/articles/archive/unit-testing-umbraco-with-umbraco-context-mock/
The problem is i use the AncestorOrSelf method and that method is not mockable.
What i can do is make a libaryclass that has a public method and calls the AncestorOrself method.
But that feels that i just move the problem.
Hope you guys can help me out
I wouldn't suggest mocking Umbraco methods :)
Well if i use them in my codebase i have to mock the methods or not use them. And not use them is no option.
I would suggest reaching out to Gary himself:
Then maybe add a PR to the documentation
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted