Skip to content

Anchor click and NavigationManager #641

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

You must be logged in to vote

Hey @jiaming0708.
It looks like you are testing what a browser would do when you click on a a href element. That is more like an integration test than a unit test (which is the intention of bUnit).
Furthermore you would test the implementation provided by Blazor. As a rule of thumb you do not want to test 3rd party code.
You can relay that Blazor (NavigationManager, Router, ...) does the right thing once you click on a href element.

Replies: 3 comments 3 replies

Comment options

linkdotnet
Feb 22, 2022
Maintainer Sponsor

You must be logged in to vote
1 reply
@jiaming0708
Comment options

Answer selected by jiaming0708
Comment options

You must be logged in to vote
0 replies
Comment options

linkdotnet
Feb 22, 2022
Maintainer Sponsor

You must be logged in to vote
2 replies
@egil
Comment options

egil Feb 22, 2022
Maintainer

@linkdotnet
Comment options

linkdotnet Feb 22, 2022
Maintainer Sponsor

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