Skip to content
CodeKruPro

Stub or mock: which one is this?

QuizMedium

A sign-up test replaces the real email service with a fake one. After the sign-up call, the test checks that the fake received exactly one "welcome" request for the new address. What kind of test double is the fake?

  • A mock, because the test verifies how it was called
  • A stub, because it returns a ready-made answer
  • A contract test
  • Service virtualization

This question is part of Pro+

Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.

See Pro+

Already have Pro+? Sign in