How to create maintainable and testable Blazor components
summary
Concrete claim: a maintainable Blazor data-table is simpler when reflection logic moves to a helper and rendering splits into DataTableHeader and DataTableRow components so each one does one thing. Implementation uses a generic TItem, System.Reflection to read public instance properties, and dependency-abstraction for HTTP/DB. Tests use bUnit with a TestContext, Razor test files, semantic assertions like MarkupMatches and component queries via FindComponent, running fast without a real browser.
AI-written summary · about
chapters (10)
- 0:00Start
- 6:23Properties of maintainable components
- 14:21Refactored
- 20:35Test of component
- 24:00Functionality testing-configure pizza dialog
- 25:52To verifying markup, do it semantically!
- 26:56Semantically verifying markup
- 28:20Semantic verification modifiers
- 29:20Creating maintainable tests
- 34:07Summary - testing
related talks
54mHow to create maintainable and testable Blazor components
55mBest practices unit testing Blazor components with bUnit
01h 16mTest-Driven Development With Blazor
39mBlazor Stability Testing for Bullet Proof Application
38mTesting Blazor Application Components: Fun with Benefits
37mTesting Blazor Components
59mBlazor-testing from A to Z
46mClean Testing: Clean Architecture with .NET Core
