Unit Testing in Visual Studio 2022

26 Ratings

Course Number: VS-114

Duration: 2 days (13 hours)

Format: Live, hands-on

Visual Studio 2022 Training Overview

This Unit Testing in Visual Studio 2022 training course teaches attendees how to use Visual Studio to design, write, and run high-quality .NET unit tests. Students learn how to use Visual Studio as it relates to unit testing and Test-Driven Development. This course also introduces other popular unit testing tools and techniques and demonstrates how they integrate with Visual Studio and your development lifecycle.

Note: This course can also be taught using Visual Studio 2019.

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, we offer some courses as live, instructor-led online classes for individuals.

Objectives

  • Understand the concepts of unit testing
  • Write, run, and manage unit tests and test results
  • Incorporate Test Driven Development (TDD) and understand the business case for why one should practice it
  • Write high-quality unit tests
  • Work with additional unit testing features found in Visual Studio
  • Use tools and techniques for testing difficult code, such as code with runtime dependencies

Prerequisites

Before attending this course, students should have experience or familiarity with:

  • The Visual C# language
  • Visual Studio 2019 or 2022
  • Writing, debugging, and maintaining code
  • Application Lifecycle Management basics
  • Building a high-quality software product
  • Their organization’s development lifecycle

Outline

Expand All | Collapse All

Unit Testing in .NET
  • What is (and isn’t) a unit test
  • Why write unit tests
  • .NET unit testing frameworks
  • MSTest, NUnit, xUnit
  • The anatomy of a unit test
  • Writing and running your first unit test
Unit Testing in Visual Studio
  • Testing support in Visual Studio
  • MSTest, NUnit, and xUnit test projects
  • Test Explorer and other windows
  • Writing and running unit tests in Visual Studio
  • Managing a large number of tests and test results
  • Organizing tests by grouping, filtering, and playlists
  • Continuous testing in Visual Studio
Test-Driven Development (TDD)
  • TDD overview and benefits
  • Practicing TDD within Visual Studio
  • Effectively refactoring code
  • Working with legacy code
  • Using CodeLens to support TDD and refactoring
Writing Good Unit Tests
  • Asking questions about your code
  • Path testing (e.g., happy, sad, evil, etc.)
  • Right BICEP testing
  • Testing for expected exceptions
  • Maintaining high-quality test code
  • Unit test naming conventions (e.g., BDD)
  • Organizing unit tests
Leveraging Visual Studio
  • Analyzing code coverage
  • Using code coverage as a metric
  • Data-driven (parameterized) unit tests
  • DataRow, DynamicData, and DataSource attributes
  • Concurrent testing using Live Unit Testing
  • Concurrent testing using NCrunch
Testing Difficult Code
  • The need to isolate code under test
  • Doubles (dummies, stubs, fakes, and mocks)
  • Microsoft Fakes framework (stubs and shims)
  • Comparing mocking frameworks
  • Using moq .NET mocking framework
  • Debugging and profiling slow-running unit tests
  • Using IntelliTest with legacy code
Conclusion

Training Materials

All Unit Testing training students receive comprehensive courseware.

Software Requirements

  • Visual Studio 2019 or 2022 with the latest update
  • Access to an Azure DevOps Server instance
  • Related lab files that Accelebrate would provide


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