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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:13:33+00:00 2026-05-19T10:13:33+00:00

When testing an ASP.NET MVC 2 application I hit a problem when a view

  • 0

When testing an ASP.NET MVC 2 application I hit a problem when a view could not be located.

Looking at the code I realised that the aspx file for the view had not been added to the source control repository. On this project that’s quite easy to do as we use StarTeam for source control and it doesn’t show new folders when checking in. This view was for a new controller and so a new folder was created for it and it was therefore missed.

Our build server (using Hudson/MSBuild) didn’t pick up on this, as the code still builds fine with the aspx file missing. Our controller unit tests test the ActionResults which obviously still pass without the view there.

This got picked up in system testing but how can I catch this earlier (ideally on the build server).

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-19T10:13:34+00:00Added an answer on May 19, 2026 at 10:13 am

    You can write unit tests that test the actual view, and then if the unit test doesn’t pass on the build server, you know you have a problem. To do this, you can use a framework such as this:
    http://blog.stevensanderson.com/2009/06/11/integration-testing-your-aspnet-mvc-application/

    With this you can write unit tests such as this (from the post)

    [Test]
    public void Root_Url_Renders_Index_View()
    {
        appHost.SimulateBrowsingSession(browsingSession => {
            // Request the root URL
            RequestResult result = browsingSession.ProcessRequest("/");
    
            // You can make assertions about the ActionResult...
            var viewResult = (ViewResult) result.ActionExecutedContext.Result;
            Assert.AreEqual("Index", viewResult.ViewName);
            Assert.AreEqual("Welcome to ASP.NET MVC!", viewResult.ViewData["Message"]);
    
            // ... or you can make assertions about the rendered HTML
            Assert.IsTrue(result.ResponseText.Contains("<!DOCTYPE html"));
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've recently taken an existing ASP.NET 3.5 web forms application that was upgraded to
I am trying to get my feet wet with asp.net mvc3 and unit testing.
I have an IIS7.5 web-site, on Windows Server 2008, with an ASP.NET MVC2 web-site
I am designing a simple C# WCF service using ASP.NET 4.0 and hosted on
Given that some of the advice for implementing CQRS advocates fairly close-to-the-metal query implementation,
I like the Rails approach to web application development quite a bit, but in
What I'm looking for is a good sample of an open source WebForms site
First, let me say I've searched on this topic and did come across a
Possible Duplicate: Sending email through Gmail SMTP server with C# I would like my
In the customErrors tag in my web.config, I am pointing to a controller. In

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.