Back-end Engineering
73 learners
Isolating Dependencies with Test Doubles with C#, xUnit, & Moq
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.
C#
Moq
.NET Core
xUnit
5 lessons
26 practices
3 hours
Programming, Algorithms, and Data Structures
Lessons and practices
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#
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!
Spying on Method Calls
Spying on Urgent Notifications
Spying on Medium Priority Notifications
Spying on Multiple Method Calls
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
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
Meet Cosmo:
The smartest AI guide in the universe
Our built-in AI guide and tutor, Cosmo, prompts you with challenges that are built just for you and unblocks you when you get stuck.

Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal