Using Theory with MemberData and RenderFragments #327
SQL-MisterMagoo
started this conversation in
Show and tell
Replies: 1 comment
-
Thank you for sharing this. Personally I prefer to keep all things involving a test as close together as possible, which is why I suffer through the current editor experience. Keeping things close together makes the test much easier to read and comprehend, for everybody else and myself the next time I have read the code. Update: i do see a use for this if e.g. multiple test cases need the same render fragments as input, so this can definitely be useful in certain situations. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Watching @egil on Twitch has inspired me to finally learn bUnit.
I saw the horrible formatting issues on stream caused by using a razor file to write tests that use RenderFragments and thought - why not split them out to razor + cs code-behind and have found this works:
In
Test1.razor
(naming huh) I have my RenderFragments and a methodData
to provide those data items to the test:And then, in the
Test1.razor.cs
file, I can write my tests with proper editor support:Test1.razor.cs
I didn't find any mention of using MemberData with RenderFragments, so thought I would share :)
x Magoo
Beta Was this translation helpful? Give feedback.
All reactions