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

The Archive Base Latest Questions

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

I want to mock ASP.NET 3.5 behavior in order to unit test my WebControls:

  • 0

I want to mock ASP.NET 3.5 behavior in order to unit test my WebControls: I want to test how they perform with mock data with existing system of events. Basically I want to test generated result HTML based on input mock data.

How to do it?

I looked into NMock, but it doesn’t suit my needs for 2 reasons:

  1. It just runs ASP.NET server in
    separate process in order to get
    resulting HTML;
  2. My WebControls output HTML as a text
    on render, so there are elements
    which do not correspond to any
    ASP.NET control (except
    LiteralControl in some cases).

Also, I have huge legacy system, so rewriting everything for MVC won’t work for me (too much job), I need to write unit tests to existing controls.

  • 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-13T16:51:34+00:00Added an answer on May 13, 2026 at 4:51 pm

    Unit testing is really ideal for middle-tier and back-end code which can be called without regard to the environment or context. The more you can separate out your code and build environmental/contextual requirements into parameters the easier and more reliable it is to test.

    Unit testing UI code is not as straightforward. Typically the best thing is to separate the pure UI code (html generation in this case) from the UI-related logic code into a View and ViewModel classes. However, you said you have a large codebase and can’t make major changes.

    Therefore it’s probably appropriate to look at the next step beyond unit testing. Use a UI-based regression testing tool to do UI automation and verification.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to unit test my websocket on node.js and want to mock out
I'm trying to get my head around how one would unit test an ASP.NET
I want to mock the Microsoft.Office.Interop.Excel.Range (and the other Microsoft.Office.Interop.Excel interfaces) to unit test
I'm working with a ASP.NET MVC solution in a test driven manner and I
I'm trying to add unit testing to an ASP.NET MVC application I have built.
I am fairly new to unit testing. I am building an ASP.NET MVC3 application
In my QUnit test I want to mock out autocomplete method (jQuery UI), but
I am using mock for testing in Python. I am trying to unit test
I'm trying to write a test for an ASP.Net MVC controller action. I'd like
I have an ASP.Net MVC3 project that calls a WCF service to get data.

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.