Skip to content

bUnit testing a dropdown button #1381

Answered by linkdotnet
BenPughyy asked this question in Q&A
Discussion options

You must be logged in to vote

I am no expert in SyncFusion - but couldn't you just retrieve every MenuItem component and check the id's against them?

var menuItems = cut.FindComponents<MenuItem>();

PS:
RenderComponent is a method defined on the TestContext(Base). You would call RenderComponent to initially render a component - but as you already did this, everything is "rendered" - including your context menu.

If you would print out the markup: cut.Markup or contextMenu.Markup you would see your entries (and probably id's as well).

Replies: 1 comment 3 replies

Comment options

linkdotnet
Feb 16, 2024
Maintainer Sponsor

You must be logged in to vote
3 replies
@BenPughyy
Comment options

@linkdotnet
Comment options

linkdotnet Feb 16, 2024
Maintainer Sponsor

Answer selected by BenPughyy
@BenPughyy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants