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

Unit testing with Blazor - Blazor Tutorial

From the course: Blazor: Getting Started

Start my 1-month free trial

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…

Contents