If playback doesn't begin shortly, try restarting your device.
•
You're signed out
Videos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer.
CancelConfirm
Share
An error occurred while retrieving sharing information. Please try again later.
1,863 views • Streamed live on Aug 23, 2023 • #blazor #dotnet #bunit
Show less
In this talk, you will learn how to get started creating tests for your Blazor components using bUnit, in a way that feels almost like regular unit testing.
bUnit is a library you add to a regular .NET testing project, e.g., a xUnit test project, that allows you to render your component with minimal effort, inspect the produced markup after each render and interact with the component under test. There is no browser involved, headless or otherwise, which means tests run fast and are predictable, just like regular unit tests.
The talk will cover all the basics, from setting up a bUnit test project to writing tests that render a…...more
In this talk, you will learn how to get started creating tests for your Blazor components using bUnit, in a way that feels almost like regular unit testing.
bUnit is a library you add to a regular .NET testing project, e.g., a xUnit test project, that allows you to render your component with minimal effort, inspect the produced markup after each render and interact with the component under test. There is no browser involved, headless or otherwise, which means tests run fast and are predictable, just like regular unit tests.
The talk will cover all the basics, from setting up a bUnit test project to writing tests that render and interact with Blazor components.
Speakers: Egil Hansen and Steven Giesel
https://github.com/bUnit-dev/bUnit / egilhansen / steven-giesel #dotnet#blazor#bunit
Host: Matthias Koch
0:00 Welcome!
1:11 About OSS PowerUps
3:21 Hello Egil and Steven!
9:37 What is bUnit and why is it necessary?
14:27 Installing bUnit into a project
20:00 Testing a Counter component
25:44 Let's make that test fail!
26:44 About Speed, JavaScript and end-to-end tests
32:24 .NET CLI template (dotnet new)
33:00 Mixed test flavors (Razor vs. C#)
36:02 MarkupMatches assertions
40:07 Cascading parameters in Razor tests
43:07 What should you test?
47:55 Cascading parameters in C# tests
52:02 Razor compiler
53:35 Injecting dependencies/services into components
55:38 Stubbing components (e.g., third-party)
1:07:58 Generation of stub classes (source generators?)
1:15:18 Debugging
1:18:12 Mocking JavaScript calls
1:24:30 Outro…...more