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
Hi all,
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
Hi Julien,
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:
https://twitter.com/garydevenay
Then maybe add a PR to the documentation
has anyone solved this, am having the same issues ?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
what are my options to mock AncestorOrSelf method?
Hi all,
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
Hi Julien,
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:
https://twitter.com/garydevenay
Then maybe add a PR to the documentation
has anyone solved this, am having the same issues ?
is working on a reply...