Mocking TelerikMediaQuery

1 Answer 19 Views
MediaQuery
Valeriy
Top achievements
Rank 1
Valeriy asked on 28 May 2021, 08:19 AM
Hello,

How can I mock TelerikMediaQuery for testing (with bUnit) ?

Regards

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 28 May 2021, 08:48 AM

Hi Valeriy,

The media query component uses JavaScript, because there is no other way to handle media queries. Thus, it cannot be mocked through the RenderTree.

What you can consider is mocking the value it will return. Ultimately, what the component does is to give you an event and a boolean value that you will populate in the view-model. You should mock that value.

Regards,
Marin Bratanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
MediaQuery
Asked by
Valeriy
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or