ASP.NET 8 Test-Driven Development

14 Ratings

Course Number: NET-324
Duration: 4 days (26 hours)
Format: Live, hands-on

ASP.NET 8 Training Overview

This ASP.NET Test-Driven Development (TDD) training course teaches TDD techniques with ASP.NET web applications. The course covers ASP.NET MVC development, including how to unit test both server-side C# code and client-side JavaScript/TypeScript code. The course can be customized to omit JavaScript or replace JavaScript with TypeScript. Optionally, the course includes ASP.NET Blazor and the unit testing of Razor Components. The course focuses on TDD's principles, best practices, and application in ASP.NET and client-side JavaScript code.

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 principle and best practices of Test-Driven Development
  • Apply TDD in ASP.NET and JavaScript/TypeScript code
  • Explore the parts of unit testing and E2E testing
  • Practice how to organize unit tests
  • Understand what needs to be tested for different parts of the application
  • Enable testing in isolation with mocks, stubs, and fakes
  • Integrate testing into local development tools and CICD pipelines (Azure DevOps or GitHub)

Prerequisites

All students must have experience with the following:

  • C# and ASP.NET technologies
  • JavaScript or TypeScript

Outline

Expand All | Collapse All

Introduction
  • What’s New in .NET 7
  • What is Test-Driven Development?
  • Benefits of TDD
  • Challenges of TDD
Principles of TDD (inspired by “Uncle” Bob Martin)
  • Three Laws of TDD
  • Clean Tests
  • One Assert Per Test
  • Five Rules: FIRST
    • Fast
    • Independent
    • Repeatable
    • Self-Validating
    • Timely
  • Red, Green, Refactor Technique
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
  • Testing Frameworks
    • MSTest
    • NUnit
    • XUnit
  • Test Runners
    • Command-Line
    • Visual Studio
    • Visual Studio Code
  • Testing Libraries
    • Mocking with Moq
    • Fluent Assertions
    • BUnit (for classes using Blazor)
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
ASP.NET MVC Test-Driven Development (focus is on testing REST APIs)
  • What Should be Tested on an MVC application?
  • Integrate Test Projects into a Solution
  • Testing Controllers
  • Testing APIs
  • Integration Testing of APIs
ASP.NET Blazor Test-Driven Development
  • 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
Mocking Databases (choose 1)
  • Entity Framework
  • Dapper
JavaScript Test-Driven Development
  • Is JavaScript Unit Testing a Thing?
  • Benefits of Unit Testing JavaScript
  • Challenges of Unit Testing JavaScript
JavaScript Testing Frameworks Overview
  • Jest
  • Jasmine
  • Mocha
JavaScript Test Runners Overview
  • Jest
  • Karma
JavaScript E2E Testing Overview
  • What is End-To-End Testing?
  • Selenium WebDriver
  • Cypress
JavaScript TDD with BDD
  • What is Behavior-Driven Development?
  • Coding Unit Tests around Behavior vs Functions
  • Given-When-Then
JavaScript Unit Testing (will be covered with Jest or Jasmine)
  • Test Suites
  • Tests
  • Assertions
  • Mocks and Spies
JavaScript E2E Testing (will be covered with Selenium)
  • Finding Elements in the DOM Tree
  • Page Objects
Testing JavaScript Code Frameworks
  • Plain Vanilla JavaScript (can use Jest or Jasmine)
    • 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
Code Coverage
  • What is Code Coverage?
  • What can be understood from Code Coverage?
  • What are the limitations of Code Coverage?
  • Generate Code Coverage reports for ASP.NET C# code
  • Generate Code Coverage reports for JavaScript code
  • Integrate code coverage into CICD systems (Azure DevOps or GitHub Actions)
Conclusion

Training Materials

All TDD training attendees receive courseware and code covering the topics in the class.

Software Requirements

  • Visual Studio 2022, Visual Studio Code, or JetBrains Rider
  • Windows, macOS, or Linux
  • .NET 8.0 SDK
  • Node.js (latest LTS version)
  • Ability to download NuGet and NPM packages
  • LocalDB or SQL Server
  • For classes delivered online, all participants need either dual monitors or a separate device logged into the online session so that they can do their work on one screen and watch the instructor on the other. A separate computer connected to a projector or large screen TV would be another way for students to see the instructor's screen simultaneously with working on their own.


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