Unit Testing in Visual Studio

Unlock the full potential of GitHub Projects as you learn how to supercharge your team’s flow.

Upcoming Classes

Don't see a date that fits your schedule? Contact us for scheduling options at 929.777.8102


Select a learning mode button (Public, Live Virtual, etc.) for pricing, details, and a downloadable fact sheet.
Description

This two-day, instructor-led course provides students with the knowledge and skills to effectively use Visual Studio to design, write, and run high-quality .NET unit tests. The course focuses on the applicable features and capabilities of Visual Studio as it relates to unit testing and Test-Driven Development (TDD). This course also introduces other, popular unit testing tools and techniques, and demonstrates how they integrate with Visual Studio and your development lifecycle.

Who Should Attend:
This course is intended for current software development professionals who are involved with building high-quality .NET applications. Students will use Visual Studio while learning how to design, write, and run unit tests. They will also learn many relevant practices and techniques, such as TDD, CI, refactoring, and how to test difficult code.

Prerequisites:
Before attending this course, a student should have experience or familiarity with:

  • The C# language
  • Visual Studio 2017, 2019, or 2022
  • Writing, debugging, and maintaining code
  • Application Lifecycle Management basics
  • Their organization’s development lifecycle
  • Building a high-quality software product
Questions? 929.777.8102 [email protected]
Course Outline

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
  • Project views (table, board, roadmap)
  • Changing view layout
  • Filtering, grouping, and ordering
  • Creating and using custom fields
  • Crating charts using Insight

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

Questions?

On-Site/Private Training

Let us bring the learning to your team at your location or in an interactive virtual classroom!
Choose from more than 50 courses.

Combine World-Class Training and

Certification with a Conference

Maximize Your Learning Potential

STAR Conference logo

AI Con USA logo

Agile + DevOps USA logo