.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Unit Testing With Cassini Web Server

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :ASP.Net


I am trying to test my asp.net mvc 2 web site using the cassini web server. The project seems to load fine, but only static reources (such as web forms) are served to the browser.

Whenever I try a routing based request - e.g Home/Index I just get the error message saying it does not exists.

The code that sets up the web server is shown below if that help.s

I'm currently a bit stuck waiting to fix this issue. So any help would be great.


private Server m_webServer;
		private string m_serverURL;

		public void Setup()
			DirectoryInfo appBasePath = new DirectoryInfo(

			string serverPhysicalPath = appBasePath.Parent.Parent.FullName + "\\MvcApplication1";
			//string serverPhysicalPath = appBasePath.Parent.FullName;
			int webServerPort = 8090;
			string virtualDirectory = "/";
			//string pathToAppToTest = "";
			string pathToAppToTest = "AppToTest";

				m_webServer = new Server(webServerPort, virtualDirectory,

				m_serverURL = String.Format("http://localhost:{0}/{1}",
					webServerPort, pathToAppToTest);


				Debug.WriteLine(String.Format("Started Port:{0} VD:{1} PD{2}",

View Complete Post

More Related Resource Links

Unit Testing SharePoint - Past, Present, and Sporm

As I described in SharePoint: The Wild West of Software Development there is a serious problem when you develop for SharePoint: ensuring quality through unit testing is really, really hard. And that's where a new open source tool just released today called sporm (SharePoint Object Relational Mapper) comes in. While sporm provides many benefits besides simplified unit testing I wanted to focus on this topic first, because sporm's approach, which models the entity framework in the way it supports POCO's, is a unique feature not available with other SharePoint tools like LINQ to SharePoint.

Test Run: Configuration Testing With Virtual Server, Part 2


Because Virtual Server is built upon a set of COM modules, you can automate the creation and testing of virtual machines. Here we use Windows PowerShell to run the tests.

Dr. James McCaffrey and Paul Despe

MSDN Magazine December 2008

Foundations: Unit Testing Workflows And Activities


Matt Milner takes a look at some of the challenges and techniques related to testing Windows Workflow Foundation activities, workflows, and associated components.

Matt Milner

MSDN Magazine November 2008

Test Run: Configuration Testing With Virtual Server, Part 1


This time James McCaffrey sets up a virtual environment to use for configuration testing to introduce you to software configuration testing with Microsoft Virtual Server

Dr. James McCaffrey

MSDN Magazine September 2008

Unit Testing: Apply Test-Driven Development to your Database Projects


Jamie Laflen extols the benefits of TDD when applied to database development-and supplies some useful techniques along the way.

Jamie Laflen

MSDN Magazine Launch 2008

WinUnit: Simplified Unit Testing for Native C++ Applications


Maria Blees introduces WinUnit, a handy new unit testing tool for native C++ projects.

Maria Blees

MSDN Magazine February 2008

Toolbox: Powerful Text Editing, Web Testing in .NET, Extended Unit Testing, and More


Powerful Text Editing, Web Testing in .NET, Extended Unit Testing, and More

James Avery

MSDN Magazine February 2008

Toolbox: Advanced Unit Testing, Object Mocking, Profiling Your Apps and More


This month we look at advanced unit testing, object mocking, profiling, and lots more.

James Avery

MSDN Magazine January 2008

Unit Testing: Exploring The Continuum Of Test Doubles


Creating and using mock component servers simplifies unit testing. Use these examples to get started.

Mark Seemann

MSDN Magazine September 2007

Unit Testing Tips: Write Maintainable Unit Tests That Will Save You Time And Tears


Everybody's talking about unit testing and you want to get into the game too. But you don't want the tests to take up all your development time and energy. Fortunately Roy Osherove is here to dispel some testing myths and put you on the road to efficient unit testing.

Roy Osherove

MSDN Magazine January 2006

Know Thy Code: Simplify Data Layer Unit Testing using Enterprise Services


If you want to employ unit testing and test-driven development techniques in your database application development process, you'll have different factors to consider than you do when you're not involving a database. For example, you have to maintain a consistent state within the database and be able to roll back transactions when necessary. This article shows you how to get the best of unit testing for your database apps in a safe, usable manner.

Roy Osherove

MSDN Magazine June 2005

Unit Testing: Mock Objects to the Rescue! Test Your .NET Code with NMock


The problem: unit testing libraries, especially data access components, that have a complex set of dependencies. The solution: providing a dynamic mock implementation of your data access classes. Here the author explains just how to make testing easier and more reliable using NMock.

Mark Seemann

MSDN Magazine October 2004

Virtual Server 2005: Program Customized Testing Environments Without Trashing Your Machine


Efficient testing can require many different machine and server configurations but the effort needed to manage these test environments can take a toll. Microsoft Virtual Server 2005 simplifies the provisioning and management of testing environments. This article demonstrates how the extensive Virtual Server COM API can be used to create an automated application testing environment to make your testing chores a whole lot easier.

Ben Waldron

MSDN Magazine August 2004

System.EntryPointNotFoundException: Entry point was not found. when unit testing html helpers


I'm trying to unit test a very simple html helper but keep getting the following exception:

System.EntryPointNotFoundException: Entry point was not found.

public static string AdditionalUsersDropDownList( this HtmlHelper helper, int additionalUsers )


Dictionary<int, string> items = new Dictionary<int, string>( );

items.Add( 0, "None" );

for ( int i = 1; i <= 30; i++ )


items.Add( i, i.ToString( ) );


SelectList list =  new SelectList( items, "Key", "Value", additionalUsers );

return helper.DropDownList( "AdditionalUsers", list );


Load testing the report server

Hello, I want to do load testing on report server in terms of number of users, but I do not have VSTS to use the load test tool available in it. Is there any other method to do this? Also, Is opening multiple instances of report manager window and running report from each of them is equivalent to having multiple users? Regards.

Unit Testing a ASP.Net Web Application

Hi, I want to imlement the Unit Testing in my asp.net web application. How to identify the scope of this. I mean, How should i start on this front. 

Unit Testing Asp.NET Applications with with Moles and Pex

It has been a while since my last post. I will try to recover, there are some things I would like to talk about. For now, check out this fine tutorial for unit testing ASP.NET applications using Pex and Moles: http://research.microsoft.com/en-us/projects/pex/molesaspnet.pdf. Of course, don't forget Microsoft's Lightweight Automation Test Framework and WatiN! I will post on these great libraries later on.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend