In Blazor, a page is the basic unit of navigation. It is the top-level component that can be reached via a URL So, when we want a new view in your Blazor app, we will need to create a new page. In all other aspects, a page and a component have equivalent functionality. First, we … Continue reading How-To: Create New Page in Blazor
Month: February 2021
How-To: Write First bUnit Test
bUnit is a testing library for Blazor components. Its goal is to make it easy to write comprehensive, stable unit tests for these components. We will learn the steps to create our first bUnit test from setup to rendering to validation. This first test will be very simple to allow us to focus on the mechanics of creating the … Continue reading How-To: Write First bUnit Test
Lesson 5.18: The Wrap
Over the course of this chapter we learned quite a bit of new technology and patterns. This chapter really focused on taking our SimpleRPG game to production in Azure and learning how to use Azure Function to build RESTful web services. We moved our game from a single, self-contained unit to retrieving game data from … Continue reading Lesson 5.18: The Wrap
App-Idea 1: Bin2Dec
Our first project (Bin2Dec) will be a converter that takes binary numbers from input strings and converts them to their decimal value. And, we will add the ability to convert back from decimals to binary numbers as well. There are several converters in the project list, so we will create a single Blazor app with … Continue reading App-Idea 1: Bin2Dec
Lesson 5.17: Upgrade Blazor Project and Dependencies to .NET 5
With the release of .NET 5, it is time for us to upgrade our simple-game solution to the latest version of .NET. Luckily .NET 5 is actually the next progression of .NET Core 3.1, so there aren't many major breaking changes to get this to work. We need to get onto the latest versions because … Continue reading Lesson 5.17: Upgrade Blazor Project and Dependencies to .NET 5
How-to: Add bUnit Test Project to Blazor Solution
Having automated tests for our Blazor applications is very important. We can use xUnit (or any other) test framework to write unit tests for the C# classes in our app. However, some part of our logic (even if it's just the databinding logic) lives in Blazor components and pages. For those to be tested, we … Continue reading How-to: Add bUnit Test Project to Blazor Solution
How-To: Create Blazor WASM Project
Here are the quick steps to create a Blazor WebAssembly project for .NET 5 in Visual Studio. The basic template creates some extra pages and components, so we will also clean it up to produce a minimal project with a home page. This is a great starting point for all of our Blazor projects. Initial … Continue reading How-To: Create Blazor WASM Project
Lesson 5.16: Redeploy SimpleRPG Game to New Storage Account
Our game is now dependent on our Azure Function web services. All of the local game data has been deleted, so the game no longer runs standalone, and it will not launch if it doesn't have an internet connection during startup. However, since we load and cache the game data from the web services at … Continue reading Lesson 5.16: Redeploy SimpleRPG Game to New Storage Account
Lesson 1.11: The Wrap
This chapter took us through the basics of creating a console application using the Spectre.Console.Cli library. This library removes a lot of the boilerplate code needed to parse command-line arguments and map them to operations in our code. By adopting their Command pattern, we are able to focus on our code and functionality without having … Continue reading Lesson 1.11: The Wrap
Lesson 1.10: CLI End to End Tests
Unit tests are just one type of test that we can use to validate our console application. While those are validating that command logic is working in isolation, we also need to verify that our command configuration was done correctly, that our repository is working, and that the command line works the way our users … Continue reading Lesson 1.10: CLI End to End Tests