6
Gil Zilberfeld Unit Testing ASP.Net and ASP.Net MVC 23-Nov-2011

Unit Testing Asp.net and Asp.net MVC

Embed Size (px)

DESCRIPTION

Typemock webinar on testing ASP.Net and ASP.Net MVC apps, with Typemock Isolator and Ivonna.

Citation preview

Page 1: Unit Testing Asp.net and Asp.net MVC

Gil Zilberfeld

Unit Testing ASP.Net and ASP.Net MVC

23-Nov-2011

Page 2: Unit Testing Asp.net and Asp.net MVC

Agenda

• What is different from testing regular apps• The performance hit of testing with a browser• What’s new in MVC that makes it more testable• What still remains in MVC that’s still hard to test• What needs to be tested – logic• Example – testing what’s written to the client• Example – testing an MVC controller• Example – testing for security logging• Example – testing control logic with Ivonna• Call to action – download Isolator.Net and Ivonna

Page 3: Unit Testing Asp.net and Asp.net MVC

ASP.Net apps hard to test

• Rely on server state• HttpContext and friends

• Testing through browser is:• Slow to run• Hard to debug

• ASP.Net is not test-friendly• HttpContext and friends

Page 4: Unit Testing Asp.net and Asp.net MVC

And MVC?

• More test-friendly• Works through interfaces• BaseHttpContext

• But not completely• For example: Redirection• And your code

Page 5: Unit Testing Asp.net and Asp.net MVC

Examples

• ASP.Net

Page 6: Unit Testing Asp.net and Asp.net MVC

Questions?

www.typemock.com

blog.typemock.com

@typemock

www.gilzilberfeld.com

[email protected]

@gil_zilberfeld