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
.NET Day
August 29, 2025
Technology
22
0
Share
.NET Day 2025: Future-Proof Your Blazor Apps with bUnit
.NET Day
August 29, 2025
More Decks by .NET Day
See All by .NET Day
.NET Day 2025: How to Lie with AI: Understanding Bias, Ethics, and the Hidden Risks in Machine Learning
dotnetday
0
25
.NET Day 2025: Most Expensive Design Mistakes (Ever) and how to avoid them
dotnetday
0
28
.NET Day 2025: Turbocharged: Writing High-Performance C# and .NET Code
dotnetday
0
41
.NET Day 2025: Developing ASP.NET Core Microservices with Dapr: A practical guide
dotnetday
0
35
.NET Day 2025: Enhancing Legal Document Analysis with Reflection Agents, Semantic Kernel, and Azure AI Search
dotnetday
0
30
.NET Day 2025: .NET Core Testing: pushing the limits
dotnetday
0
40
.NET Day 2025: The best ways to use the latest OpenAPI features in .NET 9!
dotnetday
0
35
.NET Day 2025: Supercharged Search with Semantic Search and Vector Embeddings
dotnetday
0
30
.NET Day 2025: Tickets to Ride: Conquering Booking Chaos with Resilient .NET Architecture
dotnetday
0
31
Other Decks in Technology
See All in Technology
"うちにはまだ早い"は本当? ─ 小さく始めるPlatform Engineering入門
harukasakihara
6
520
SREの仕事は「壊さないこと」ではなくなった 〜自律化していくシステムに、責任と判断を与えるという価値〜 / 20260515 Naoki Shimada
shift_evolve
PRO
1
140
生成AI時代に信頼性をどう保ち続けるか - Policy as Code の実践
akitok_
1
220
データモデリング通り #5オンライン勉強会: AIに『ビジネスの文脈』を教え込むデータモデリング
datayokocho
0
260
ServiceによるKubernetes通信制御ーClusterIPを例に
miku01
1
160
AI時代の品質はテストプロセスの作り直し #scrumniigata
kyonmm
PRO
4
1.5k
試作とデモンストレーション / Prototyping and Demonstrations
ks91
PRO
0
200
Purview 勉強会報告 Microsoft Purview 入門しようとしてみた
masakichixo
1
370
Gaussian Splattingの実用化 - 映像制作への展開
gpuunite_official
0
160
Digital Independence: Why, When and How
wannesrams
0
310
Purview Endpoint DLP 動かしてみた
kozakigh
0
360
AI時代に、 データアナリストがデータエンジニアに異動して
jackojacko_
0
760
Featured
See All Featured
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
130
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.2k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
4 Signs Your Business is Dying
shpigford
187
22k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.9k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
180
The Art of Programming - Codeland 2020
erikaheidi
57
14k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
55k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
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