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 66849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:10:04+00:00 2026-05-10T19:10:04+00:00

Let’s say I have defined a route: routes.Add(new Route(Users/{id}, new MvcRouteHandler()) { Defaults =

  • 0

Let’s say I have defined a route:

        routes.Add(new Route('Users/{id}', new MvcRouteHandler())             {                 Defaults = new RouteValueDictionary(new { controller ='UserInfo', action = 'UserInformation',                 id = ''}),             }); 

So, how am I going to create a unit test to ensure that when Users/123 is presented in the URL the action method UserInformation is definitely called, with 123 as the parameter?

The reason I asked this is because I could have typed the wrong name when I specify the RouteValueDictionary, I could have mistyped UserInformationss in the pace of UserInformation. Is there anyway to prevent this?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-10T19:10:04+00:00Added an answer on May 10, 2026 at 7:10 pm

    It’s not important to test that the action UserInformation is called. It’s only important to make sure that when the URL is specified, that ‘UserInformation’ is in the route values dictionary with the key ‘action’ and that there’s a ‘controller’ value with the appropriate controller name.

    If so, the MVC framework guarantees that the UserInformation method will get called. You don’t need to test our code via your unit test, just yours. If our code is incorrect, let us know and we’ll add a unit test for our code. 🙂

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

Sidebar

Related Questions

Let's say I have thousands of users and I want to make the passwords
Let's say I don't have photoshop, but I want to make pattern files (.pat)
Let's say I have a method in java, which looks up a user in
Let me explain best with an example. Say you have node class that can
Let's say I have a table with a Color column. Color can have various
Let's say that I have a SQLite database that I create in a separate
Let's say I have a sortable list like this: $(.song-list).sortable({ handle : '.pos_handle', axis
Let's say I have a string like this: var str = /abcd/efgh/ijkl/xxx-1/xxx-2; How do
Let's say I have two text files that I need to extract data out
Let's say I have a custom class CustomClass, and I have a collection deriving

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.