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

  • SEARCH
  • Home
  • 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 34779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:07:55+00:00 2026-05-10T14:07:55+00:00

Alright. So I figure it’s about time I get into unit testing, since everyone’s

  • 0

Alright.

So I figure it’s about time I get into unit testing, since everyone’s been banging on about it for long enough. I’ve installed NUnit and gone through a few ‘intro to unit testing’ type tutorials.

I’m currently putting together a small framework to help with the rebuild of one of our web apps, so I’ve created a VS2008 project for my framework and I want to unit test it as I go.

How on earth do I go about unit testing the WebControls? The methods are all protected or private, and since it’s a framework, there isn’t much else but WebControls.

Any pointers?

Burns

  • 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. 2026-05-10T14:07:56+00:00Added an answer on May 10, 2026 at 2:07 pm

    You can do model-view-controller or model-view-presenter type architectures without using a full blown framework. You already found out that unit-testing ui-components is difficult. There are ways around that but you probably don’t want to go that route. Usually this will make your tests very hard to maintain, more maintenance nightmare’s is something programmers can do without 🙂

    Try to separate out the functionality you want to test in a ‘controller’ or ‘presenter’ class. Then test that class. To make it more testable you can hide the usercontrol class (the view) behind an interface and make the controller or presenter talk to the view through the interface. That way you can mock up the view in your tests.

    I know this sounds like a lot of work and it seems like a workaround but if you get used to this it’s a realy nice architecture that makes it far easier to change ui behaviour. You can always start using a ‘real’ mvc framework when you realy need it 🙂

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

Sidebar

Ask A Question

Stats

  • Questions 267k
  • Answers 267k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Since the object is referenced, you cannot modify it. This… May 13, 2026 at 12:47 pm
  • Editorial Team
    Editorial Team added an answer Try this: $filename = "/tmp"; if (!file_exists($filename)) echo $filename, "… May 13, 2026 at 12:47 pm
  • Editorial Team
    Editorial Team added an answer Your DLL is not a C# DLL, it's a .NET… May 13, 2026 at 12:47 pm

Related Questions

Alright. So I figure it's about time I get into unit testing, since everyone's
Alright, so this is something really basic, and I know that when someone tells
Hey, alright so I have a .plist that looks like; <plist version=1.0> <dict> <key>Item
I just introduced multithreading into my app JUST to get a silly UIActivityIndicatorView to
Well, I sort of want to have sort of a faint striped pattern across

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.