Home / General / A pattern for unit testable Asp.net pages: Part 4
digWin is a community news sharing site for Microsoft Techies. Share interesting news/links and rate them!

A pattern for unit testable Asp.net pages: Part 4

Okay, now for unit tests of the code from part 3. The goal is to completely cover RenamePageModel. First we need mock implementations of IPageContext and IDataAccess. For IPageContext, we are going to use special exception types for page not found and server errors. And, we'll add an accessor to track redirects. It's all pretty straightforward.

public class MockPageContext : IPageContext
{






Microsoft news, tips and tricks search

Comments


Post voted by 1 digWinners


Featured Links

User

Login | Register




Forgot Password?

Sponsor

Anti spam filter for mail servers
Anti spam, anti phishing and email management software for Exchange/SMTP/Lotus. Download a FREE trial!

Featured

Download Free Exchange Ebook

Categories

Upcoming NEW

Recent comments

Related Sites