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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:39:36+00:00 2026-05-19T14:39:36+00:00

My team is writing a content-managed web-hosting application in ASP.Net MVC 2 with the

  • 0

My team is writing a content-managed web-hosting application in ASP.Net MVC 2 with the S#arp Architecture framework. I’m using SpecFlow and WatiN for integration testing, and NUnit for unit testing.

I have a custom controller factory that locates a page in the database based on the URL and site, and then loads the proper controller and action. It also loads an error controller when the page (or site) is not found in the database.

I want to write either a unit test or integration test that validates a 404 page is properly displayed when the URL is invalid. WatiN cannot check the response header, so it cannot accurately ensure an actual 404 page was loaded. This may eliminate an integration test as the solution.

I’m new to TDD and BDD, so I may be missing something obvious. Also, I am retro-fitting tests into this project, which makes it that much more difficult.

Thanks in advance.

  • 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-19T14:39:37+00:00Added an answer on May 19, 2026 at 2:39 pm

    Normally when we write BDD scenarios, we write them from the user’s perspective.

    If the user is an ordinary person, they probably don’t care too much about whether the header is a genuine 404. They’d prefer a page giving them a clear and useful message. Write the scenario to check for the clear and useful message.

    Given no section on unicorns exists
    When the user browses for horses
    And changes the url to be about unicorns
    Then the user should be told that no such page exists.
    

    BDD isn’t really about testing. It’s about the conversations which let you discover other things you haven’t thought of, and developing a common understanding of what should happen. For instance, what happens when an ordinary user tries to access an admin page? Should they get “access denied” or simply not know that the page is there? What if a page is deleted? Those discussions are more useful than trying to pin everything down.

    If your 404 is associated with a particular message to the user, then you can simply unit-test that the appropriate response matches. That will drastically reduce the chances of accidentally sending the wrong code with a message in the future, and you can focus on the real benefit.

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

Sidebar

Related Questions

I'm writing the memory manager for an application, as part of a team of
My team has been using SVN for a few years. We now have the
My team is currently trying to automate the deployment of our .Net and PHP
My team is developing a new service oriented product with a web front-end. In
My team is moving from Visual SourceSafe to Subversion soon, while developing/supporting a legacy
Our team develops distributed winform apps. We use ClickOnce for deployment and are very
Our team is creating a new recruitment workflow system to replace an old one.
My team is working on a crappy old website and most of the pages
Our team is setting up nightly and continuous integration builds. We own Team Foundation
My team has a command parsing library for console apps. Each team around us

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.