Mocking of GetPage() method in widget

Shyam Kushwaha asked on February 22, 2023 07:22

I am trying to mock GetPage() method in custom widget. But did not fond any proper solution. Can please anyone provide solution of this problem.

Recent Answers


Not Applicable answered on February 22, 2023 10:57

Use the IPageDataContextRetriever in your code, instead of the GetPage() method. Then you can mock that interface. This might help, Developing widgets - Accessing the data of the current page.

0 votesVote for this answer Mark as a Correct answer

Shyam Kushwaha answered on February 23, 2023 05:13

Thank you for reply. Currently i am working in Kentico 12, This interface(IPageDataContextRetriever) does not supported in Kentico 12. Pease suggest me mocking of getpage() method in kentico 12.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.