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

  • SEARCH
  • Home
  • 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 4335648
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:41:56+00:00 2026-05-21T10:41:56+00:00

In the documentation for Rhino Mocks it states that you must verify expectations on

  • 0

In the documentation for Rhino Mocks it states that you must verify expectations on a mock which must be verified/asserted later using either the VerifyAllExpectations() or AssertWasCalled() methods.

However if I comment out the verification the test still passes. So I am wondering why you would need to have the verify expectation call at all.

...
notificationSvc.Expect(o => o.UserIsLoggedOut());       
...
//notificationSvc.VerifyAllExpectations();
  • 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-21T10:41:56+00:00Added an answer on May 21, 2026 at 10:41 am

    Verifying an Expectation is as vital to a test case, as is an Assert statement is for a Test.

    You can write any amount of code without Assert statements in a Test method, It would pass.
    But the question is – “Is it Testing anything ?”

    The Assert statement(s) are the crux of the Test Case.

    Similarly the Verify methods are the crux of all Expectation calls, without Verify method your test case is as good as a Test case without an Assert statement.

    A System interaction could be verified using Expectations, It’s a three step proccess

    1. Setting Expectations: Letting know the mocking framework what interactions are you expecting to be invoked.
    2. Interact or Perform actions:: Perform the actual call which you want to test on the SUT(System Under Test)
    3. Verifying Expections: Asking the mocking framework to Verify all the expectations were met while performing Step 2.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Documentation states that You must use /EHa when using _set_se_translator.. My question is: should
The documentation here states that developers must call the EndExecuteNonQuery method to finish the
Sometimes Rhino.Mocks is driving me mad, 'cause there's not enough documentation on topics that,
The documentation for the method getItemPosition in Android's PagerAdapter class states that it is:
Arg<T>.Property is part of the documentation on inline constraints for Rhino Mocks v3.5, but
Documentation states that interface delegation is available for Win32 only. Currently I can't test
The documentation for the keyword is states that: The is operator only considers reference
Documentation states that 'handleResponseEnd' is called when the response has been completely received. http://twistedmatrix.com/documents/11.0.0/api/twisted.web.http.HTTPClient.html#handleResponseEnd
Documentation for logging module says that If you are implementing asynchronous signal handlers using
The documentation basically says that range must behave exactly as this implementation (for positive

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.