Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
.NET Day 2025: Future-Proof Your Blazor Apps wi...
Search
dotnetday
August 29, 2025
Technology
0
4
.NET Day 2025: Future-Proof Your Blazor Apps with bUnit
dotnetday
August 29, 2025
Tweet
Share
More Decks by dotnetday
See All by dotnetday
.NET Day 2025: Developing ASP.NET Core Microservices with Dapr: A practical guide
dotnetday
0
4
.NET Day 2025: Enhancing Legal Document Analysis with Reflection Agents, Semantic Kernel, and Azure AI Search
dotnetday
0
4
.NET Day 2025: .NET Core Testing: pushing the limits
dotnetday
0
4
.NET Day 2025: The best ways to use the latest OpenAPI features in .NET 9!
dotnetday
0
5
.NET Day 2025: Supercharged Search with Semantic Search and Vector Embeddings
dotnetday
0
4
.NET Day 2025: Tickets to Ride: Conquering Booking Chaos with Resilient .NET Architecture
dotnetday
0
4
.NET Day 2025: Code smarter, not harder: How AI Coding Tools Boost Your Productivity
dotnetday
0
7
.NET Day 2024: Mastering Integration Testing for .Net Web Apis With Webapplicationfactory and Testcontainers
dotnetday
0
78
.NET Day 2024: Backend for Frontend as a Gateway to the World of Microservices
dotnetday
0
72
Other Decks in Technology
See All in Technology
Backboneとしてのtimm2025
yu4u
4
1.6k
Goss: Faiss向けの新しい本番環境対応 Goバインディング #coefl_go_jp
bengo4com
0
1.4k
知られざるprops命名の慣習 アクション編
uhyo
11
2.6k
Preferred Networks (PFN) とLLM Post-Training チームの紹介 / 第4回 関東Kaggler会 スポンサーセッション
pfn
PRO
1
250
AIとTDDによるNext.js「隙間ツール」開発の実践
makotot
6
730
mruby(PicoRuby)で ファミコン音楽を奏でる
kishima
1
290
ドキュメントはAIの味方!スタートアップのアジャイルを加速するADR
kawauso
3
410
Figma + Storybook + PlaywrightのMCPを使ったフロントエンド開発
yug1224
10
2.9k
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
2
20k
広島発!スタートアップ開発の裏側
tsankyo
0
250
Webアクセシビリティ入門
recruitengineers
PRO
2
560
JavaScript 研修
recruitengineers
PRO
4
520
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
283
13k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Making Projects Easy
brettharned
117
6.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
Making the Leap to Tech Lead
cromwellryan
134
9.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
780
Site-Speed That Sticks
csswizardry
10
790
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
900
Reflections from 52 weeks, 52 projects
jeffersonlam
351
21k
The Cult of Friendly URLs
andyhume
79
6.6k
YesSQL, Process and Tooling at Scale
rocio
173
14k
Transcript
Future-proof Your Blazor Apps with bUnit
Who is this guy? • Hans Muns • Software Developer
& Microsoft Certified trainer @ Vitas • Newest hobby: Dog owner
The history of Blazor testing 2006 Selenium Release 2018 Blazor
Release 2020 Playwright Release 2021 bUnit Release
Why do we need a new tool? Relatively slow Not
designed for component/unit testing Mocking is hard Require browser setup
What is bUnit?
What is bUnit? It’s not a replacement for xUnit, NUnit,
TUnit, or any other unit testing framework. It’s an addition.
What is bUnit? Open-source testing library for Blazor components Enables
‘regular’ unit testing experience Supported by the .NET Foundation Doesn’t run in the browser, doesn’t run Javascript
What is bUnit?
How can we hello world this?
How can we hello world this?
How can we hello world this?
How can we hello world this?
Let’s explore a real- world use case
None
Let’s make a plan 1. Third-party components 2. Parameters &
callbacks 3. Dependency injection . 4. Verifying output.
Working with third-party components
Working with third-party components
Working with third-party components
Working with third-party components
Parameters and callbacks
Dependency injection
Semantic comparison
Semantic comparison
Semantic comparison diff:ignore <attribute>:ignore diff:ignoreChildren diff:ignoreAttributes diff:whitespace=“Normalize” diff:ignoreCase <attribute>:ignoreCase diff:regex
Let’s demo
Even more cool features Faking authorization Emulating JSRuntime Faking persistentComponentState
Faking NavigationManager Faking IWebAssemblyHostEnvironment InputFile helper to test uploading files
Let’s compare with Playwright
Comparing the counter test
Comparing the counter test
Comparing the counter test
bUnit FAQ Does bUnit replace testing tools like Selenium/Playwright? Are
there any limitations when using third party components? How can I integrate bUnit in my CI/CD pipelines? How do you go about testing javascript heavy components?
Recap Enables true unit testing Setting up your bUnit project
Semantic comparison An addition to our testsuite Mocking components Compared to other tools
Were to find more https://bunit.dev/ https://github.com/bUnit-dev/bUnit https://learn.microsoft.com/en- us/shows/visual-studio- toolbox/testing-blazor- components-with-bunit
Let’s stay connected