From the course: Blazor: Getting Started
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Unit testing with Blazor - Blazor Tutorial
From the course: Blazor: Getting Started
Unit testing with Blazor
- [Instructor] The Blazor team has decided not to make a test framework part of Blazor, but rather rely on community projects to provide ways of testing Blazor components. B unit is the most capable Blazor test framework I've seen so far. It has become the de facto standard. So I'm going to use that to test the application. Testing our services can be done with traditional unit tests, but components in Blazor are different. The input to a component is parameters, injected services and other components. The output is HTML meant to be rendered in the browser. This means that if we want to to test a components-generated class, we need to run the render pipeline and the component life cycle. This is where B unit comes in. At the time of this recording, it's still in beta, but it should reach the 1.0 version very soon. Let's get some tests going around our components in the Blazor client. I'm going to start down here in…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Debugging with Blazor7m 9s
-
(Locked)
Unit testing with Blazor8m 48s
-
(Locked)
Application changes for unit testing12m 4s
-
(Locked)
Unit testing components with parameters and services10m 4s
-
(Locked)
Forms and validation with Blazor10m 8s
-
(Locked)
Challenge: RayInput validation55s
-
(Locked)
Solution: RayInput validation3m 4s
-
-
-
-
-