Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

CodeSignal

Isolating Dependencies with Test Doubles with C#, xUnit, & Moq

via CodeSignal

Overview

Intro to test doubles in software testing - learn about dummies, stubs, spies, mocks, and fakes in xUnit. Covers using Moq framework to isolate tests, control behavior, and create maintainable test suites.

Syllabus

  • Unit 1: Isolating Dependencies with Test Doubles: Dummies
    • Understanding EmailService in TDD with Dummy Implementations
    • Enhancing Logger Interface with Severity Parameter
    • Identifying and Fixing Bugs in EmailService Tests
    • Implementing Dummy Dependencies in EmailService Tests
    • Implementing Test Doubles for NewsletterService in C#
  • Unit 2: Isolating Dependencies with Test Doubles: Stubs
    • Stubbing for Weather Alerts
    • Handle freezing conditions with Stubbed data
    • Replace the hand-built Stub with Moq
    • Handling stormy conditions
    • Stubbing Out Lovely Weather
    • Refactor!
  • Unit 3: Utilizing Spies in Test Driven Development with Moq
    • Spying on Method Calls
    • Spying on Urgent Notifications
    • Spying on Medium Priority Notifications
    • Spying on Multiple Method Calls
  • Unit 4: Mocking Dependencies with Moq in TDD
    • Mock Pricing Service for Testing
    • Verifying Dependencies Aren't Called using Mocks
    • Expect Exceptions for Negative Prices
    • Mocking Multiple Calls with Mock Implementations
    • Calculating Bulk Prices
  • Unit 5: Isolating Dependencies with Test Doubles: Fakes
    • Using a Fake User Repository
    • Expect an Exception When Adding Duplicate Users
    • Update a Registered User
    • Handle when Updating Non-Existent Users
    • Deactivating Users
    • Expect Exception when Deactivating Non-Existent Users

Reviews

Start your review of Isolating Dependencies with Test Doubles with C#, xUnit, & Moq

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.