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 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

Team, I have an ASP.NET MVC application that I'm deploying. When I deploy it
Our team is writing its first JSF 2.0 application since using Stripes for many
I'm writing an ASP.NET MVC site that includes the possibility for users to create
I'm writing a command-line development utility for my team, using Ruby. I'm trying to
My team is using Entity Framework 4.3.0 - Code Only with POCO classes as
the rest of our team and me created a Silverlight application. We've been using
I'm writing a work management application in C# for my team at work (because
I'm writing a simple asp page to show a team rota based on some
Recently I participated in designing & writing of an application which my team was
I'm writing an application that needs to connect to the Team Foundation Server, and

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.