Unit Testing Blazor Components with xUnit and bUnit
Unit Testing Blazor Components with xUnit and bUnit
Setting Up a Unit Test Project for Blazor
Let's create unit tests for a Blazor application. In the provided code sample, you'll find a test solution. Open it with your preferred editor. The solution should look familiar, containing Counter and FetchData components that use IWeatherService to r ...
Posted on Mon, 08 Jun 2026 17:12:30 +0000 by mdaoust
Blazor Components and Application Structure
Understanding Blazor Components Every Razor file in Blazor represents a component. That's the fundamental concept! A Blazor Razor file contains markup and can include C# code within an @code section. Each page in our application is essentially a component, and these components can be composed by nesting other components within them.
Any class t ...
Posted on Fri, 15 May 2026 12:39:38 +0000 by MHardeman25
Understanding Data Binding in Blazor
Introduction to Razor Syntax
Blazor, a portmanteau of Browser and Razor, leverages the Razor templating syntax for component development. Understanding Razor is key to mastering Blazor. Razor allows embedding code within templates, enabling dynamic content generation for HTML, code, and other formats. Initially introduced with ASP.NET MVC, Razo ...
Posted on Mon, 11 May 2026 12:00:07 +0000 by Beatnik
Implementing JavaScript and TypeScript Interoperability in Blazor WebAssembly
Setting Up the Project
Create a new Blazor WebAssembly App and name it BlazorTSInterop. Select .NET 6.0 client-only with no authentication and no PWA support. Run the application in hot reload mode with CTRL+F5.
The template includes counter and fetch data pages that won't be needed for this demonstration. We'll work exclusively with the home p ...
Posted on Mon, 11 May 2026 09:03:49 +0000 by eva21
Building and Analyzing a Hosted Blazor WebAssembly Solution
Scaffolding the Project with the .NET CLITo create a new hosted Blazor WebAssembly project using the command line, open a terminal and navigate to your desired output directory. Execute the following command, which specifies the blazorwasm template, includes the --hosted flag to generate an accompanying ASP.NET Core server project, and outputs ...
Posted on Sun, 10 May 2026 14:36:55 +0000 by perpetualshaun