Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3672922
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:40:07+00:00 2026-05-19T02:40:07+00:00

In Roy Osherove’s book [Unit Testing][1] book, he explains that a single unit test

  • 0

In Roy Osherove’s book [Unit Testing][1] book, he explains that a single unit test should contain between 0 and 1 mocks. He suggests that if your test isn’t asserting on the mock, then don’t use a mock at all. He further demonstrates how to use an isolation framework to produce stubs, which were created similarly to the mocks. He places no suggested limit on the number of stubs created per test.

My question is this: can those recommendations be applied to all isolation frameworks (or all popular C# frameworks)? In other words, is there a framework that can generate only mocks – not stubs? Is there an isolation framework that does not distinguish mocks from stubs?

I’m just curious how easy Osherove’s recommendations can be converted into coding standards.

[1]: http://the system under test isn’t even being tested at all, instead data returned from mocks is what is being tested.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T02:40:08+00:00Added an answer on May 19, 2026 at 2:40 am

    There are frameworks like Moq that does not distinguish them. FakeItEasy goes even further and calls everything fake objects.

    Yes, they can be applied, because mocks are just smarter stubs. It does not matter that much if stub gets called as mock as long as You don’t assert on more than one mock. That recommendation in other words is more about asserting only one thing per test. Explicitly distinguishing mocks and stubs isn’t that important.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I follow the technique specified in Roy Osherove's The Art Of Unit Testing book
In the book 'The Art Of Unit Testing' by Roy Eshorove, the unit test
Recently I have been reading The Art Of Unit Testing book by Roy Osherove
I've just finished reading Roy Osherove's The Art of Unit Testing and I am
I've started experimenting with Rhino-Mocks (3.6) while reading Roy Osherove's The Art of Unit
I like the unit tests naming convention recommended by Roy Osherove where unit tests
I'm trying to find a unit test framework, for the .NET platform, that can
I have a native Delphi TFrame that emulates Roy Tanck's Cumulus Tag Cloud viewer,
I'm making a page that should display the variable of my choosing within a
i am quite blur in using repeater is that any way do not display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.