Interested in a
Personal Demo ?


Name* :
Please Enter your Name
Company E–Mail* :
Please Enter a Valid Email

Testimonials


"Holy crap, this thing is hot. In technical terms, you might call it the *bomb-diggity*. I haven’t been this stoked about a technology for quite some time..."
Travis Illig, Senior Software Engineer, Fiserv
Success stories

PurchaseOptions


US Toll Free
866–895–4680
Outside US
+44–203–150–0293
Get your printable quote
Buy online

 

Unit Testing ASP.NET

There are many advantages for unit testing ASP.Net (Classic / WebForms or MVC) with Typemock Isolator. These include shortening the development cycle, reducing the development costs, increasing code coverage, releasing a product with less bugs, providing good documentation and more...

Typemock Isolator allows you to isolate ASP.Net objects such as the problematic-to-test HTTPContext. You can test any ASP.Net logic, by isolating the ASP.Net objects. But if you'd like to take your unit tests a step further, Ivonna, by Artem Smirnov, will help you to unit test ASP.Netwith even greater ease.

Ivonna is built on top of Typemock Isolator, and allows you to write tests just like you would write regular ASP.Net code. Ivonna allows you test and isolate ASP intrinsic objects (for example, the Page and HttpContext objects) in your test code. You can then test the page behavior in isolation from any dependencies.

Unit Testing ASP.NET Code Sample C#

 

[TestFixture, RunOnWeb]
public class MethodTester 
{
         [Test]
  	public void WhenShowMessageIsInvoked_MessageLabelShowsTheMessage() 
	{
   	     var session = new TestSession(); //start a browsing session
   	     var page = session.GetPage("Default.aspx"); //request a page
   	     (page as IView).ShowMessage("message"); //invoke the method
   	     Label messageLabel = page.FindControl("MessageLabel") as Label;//find  label
   	     Assert.AreEqual("message", messageLabel.Text, "Invalid text");//check  text
  	}
}


           

View a VB.NET unit testing ASP.NET code sample here – requires both Isolator, and Ivonna

 

Typemock Isolator:

Free 15-day trial of Isolator Complete

Ivonna:

Free Download

Buy Ivonna Now

 Resources