Blazor Testing


Course Number: ASPNC-118
Duration: 2 days (13 hours)
Format: Live, hands-on

Blazor Testing Training Overview

This Blazor training course teaches attendees the fundamental principles and best practices for testing Blazor applications. Participants learn to organize and execute tests using C# and JavaScript specifically for Blazor applications, including isolated testing with mocks, stubs, and fakes.

The course focuses on programming and executing unit and integration tests for Razor Components, as well as E2E tests for Blazor web pages to enhance the robustness and reliability of Blazor applications.

Location and Pricing

Accelebrate offers instructor-led enterprise training for groups of 3 or more online or at your site. Most Accelebrate classes can be flexibly scheduled for your group, including delivery in half-day segments across a week or set of weeks. To receive a customized proposal and price quote for private corporate training on-site or online, please contact us.

In addition, some courses are available as live, instructor-led training from one of our partners.

Objectives

  • Learn the principles and practices of testing Blazor applications
  • Review the differences between unit, integration, and end-to-end (E2E) testing
  • Practice how to organize C# and JavaScript tests
  • Understand what needs to be tested for Blazor Applications
  • Enable testing in isolation with mocks, stubs, and fakes
  • Program and run unit and integration tests for Razor Components 
  • Program and run E2E tests for Blazor web pages

Prerequisites

Students need HTML, CSS, JavaScript, and C# programming experience. Prior experience with Blazor is required. If your attendees do not yet have this expertise, please let us know so that we can customize your class to cover the necessary prerequisite(s).

Outline

Expand All | Collapse All

Introduction
Kinds of Testing
  • Unit Tests
  • Integration Tests
  • E2E Testing
  • Automated vs. Manual Testing
  • Testing & DevOps
Testing Parts
  • Tests
  • Test Suites
  • Assertions
  • Setup/Teardown
  • Mocks, Fakes, Stubs
  • Arrange, Act, Assert
  • Test Frameworks
  • Test Runners
  • Code Coverage
Overview of .NET Core and Testing
  • XUnit
  • Test Runners:  Command-Line, Visual Studio, Visual Studio Code, JetBrains Rider
  • Testing with XUnit and the Selected IDE (see above)
  • Mocking with Moq
  • Fluent Assertions
  • BUnit
Test C# and Razor code with xUnit
  • What is xUnit?
  • Testing Framework
  • Test Parallelism
  • Shared Test Context
  • Facts vs. Theory
  • Assertions
  • Integration with Visual Studio
  • Debugging Unit Tests in Visual Studio
  • Debugging Unit Tests in Visual Studio Code
Razor Component Unit and Integration Testing
  • What Should be tested on a Razor Component?
  • What is bUnit?
  • Using bUnit with xUnit
  • Setup and define components under tests in C# or Razor syntax
  • Verify outcome using semantic HTML comparer
  • Interact with and inspect components
  • Trigger event handlers
  • Provide cascading values
  • Inject services
  • Mock IJsRuntime
  • Perform snapshot testing
JavaScript Testing
  • Is JavaScript Unit Testing a Thing?
  • Benefits of Unit Testing JavaScript
  • Challenges of Unit Testing JavaScript
  • Testing JavaScript with Jest
  • Test Suites
  • Tests
  • Assertions
  • Mocks and Spies
JavaScript Testing within a Blazor Project
  • Configure Unit Testing for a JavaScript/TypeScript project
  • Organize Code for Efficient Testing
  • Mocking the DOM
  • Testing DOM Manipulation Code
  • Testing AJAX Code
  • Running Tests
  • Debugging Tests
E2E Testing Overview
  • What is End-To-End Testing?
  • Selenium WebDriver
  • Program and Run E2E tests with C#
  • Finding Elements in the DOM Tree
  • Page Objects
Conclusion

Training Materials

All students receive comprehensive courseware covering all topics in the course. Courseware is distributed via GitHub through documentation and extensive code samples. Students practice the topics covered through challenging hands-on lab exercises.

Software Requirements

Students will need a free, personal GitHub account to access the courseware. This course can be taught with Visual Studio, Visual Studio Code, or JetBrains Rider. Students will need permission to install the selected IDE on their computers. Also, students will need permission to install NuGet Packages. If students are unable to configure a local environment, a cloud-based environment can be provided.



Learn faster

Our live, instructor-led lectures are far more effective than pre-recorded classes

Satisfaction guarantee

If your team is not 100% satisfied with your training, we do what's necessary to make it right

Learn online from anywhere

Whether you are at home or in the office, we make learning interactive and engaging

Multiple Payment Options

We accept check, ACH/EFT, major credit cards, and most purchase orders



Recent Training Locations

Alabama

Birmingham

Huntsville

Montgomery

Alaska

Anchorage

Arizona

Phoenix

Tucson

Arkansas

Fayetteville

Little Rock

California

Los Angeles

Oakland

Orange County

Sacramento

San Diego

San Francisco

San Jose

Colorado

Boulder

Colorado Springs

Denver

Connecticut

Hartford

DC

Washington

Florida

Fort Lauderdale

Jacksonville

Miami

Orlando

Tampa

Georgia

Atlanta

Augusta

Savannah

Hawaii

Honolulu

Idaho

Boise

Illinois

Chicago

Indiana

Indianapolis

Iowa

Cedar Rapids

Des Moines

Kansas

Wichita

Kentucky

Lexington

Louisville

Louisiana

New Orleans

Maine

Portland

Maryland

Annapolis

Baltimore

Frederick

Hagerstown

Massachusetts

Boston

Cambridge

Springfield

Michigan

Ann Arbor

Detroit

Grand Rapids

Minnesota

Minneapolis

Saint Paul

Mississippi

Jackson

Missouri

Kansas City

St. Louis

Nebraska

Lincoln

Omaha

Nevada

Las Vegas

Reno

New Jersey

Princeton

New Mexico

Albuquerque

New York

Albany

Buffalo

New York City

White Plains

North Carolina

Charlotte

Durham

Raleigh

Ohio

Akron

Canton

Cincinnati

Cleveland

Columbus

Dayton

Oklahoma

Oklahoma City

Tulsa

Oregon

Portland

Pennsylvania

Philadelphia

Pittsburgh

Rhode Island

Providence

South Carolina

Charleston

Columbia

Greenville

Tennessee

Knoxville

Memphis

Nashville

Texas

Austin

Dallas

El Paso

Houston

San Antonio

Utah

Salt Lake City

Virginia

Alexandria

Arlington

Norfolk

Richmond

Washington

Seattle

Tacoma

West Virginia

Charleston

Wisconsin

Madison

Milwaukee

Alberta

Calgary

Edmonton

British Columbia

Vancouver

Manitoba

Winnipeg

Nova Scotia

Halifax

Ontario

Ottawa

Toronto

Quebec

Montreal

Puerto Rico

San Juan