Verify behavior of different test doubles in a payment processing system
Preconditions (3)
Step 1: Use DummyPaymentGateway to create a PaymentProcessor instance and call processPayment with any amount
Step 2: Use StubPaymentGateway that returns true for processPayment and verify PaymentProcessor accepts payment
Step 3: Use FakePaymentGateway that simulates real payment logic and verify PaymentProcessor behavior
Step 4: Use SpyPaymentGateway to record if processPayment was called and verify the call count
Step 5: Use MockPaymentGateway to expect processPayment call with specific amount and verify interaction
✅ Expected Result: Each test double behaves according to its purpose: Dummy is a placeholder, Stub returns canned data, Fake has working logic, Spy records calls, Mock verifies interactions