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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:18:21+00:00 2026-06-14T13:18:21+00:00

So I am really bad about not remembering to make unit tests for new

  • 0

So I am really bad about not remembering to make unit tests for new classes that I’ve created. I try my best to adhere to TDD, but sometimes I forget. I’m good about running tests (as it is just one button) So is there a way to scan a namespace for all classes, and check to see if they are derived from a known class.

For instance. I have a Contact class. I have 3 sub classes of Contact (Shipping, Billing, Service) I have a unit test for all 3. Lets say a month from now I decide to derive another class from Contact. I’m super good about remember to run my unit tests, but in this case I would want it to fail just 1 test to remind me to write a unit test for my new contact class. Something like.

    [TestMethod, TestCategory("Contact")]
    public void TestAllContactsAccountedFor()
    {
        foreach(class c in theNamespace)
        {
            bool subclassOfContact = c is  Contact;
            if (subclassOfContact)
            {
                bool knownSubclass = (c is CustomerShippingContact) || (c is CustomerBillingContact) || (c is CustomerServiceContact);
                Assert.IsTrue(knownSubclass);

            }

        }
    }

this way if I forget to make a test it will fail this test, and then I account for it. Any ideas on this?

  • 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-06-14T13:18:22+00:00Added an answer on June 14, 2026 at 1:18 pm

    You should try Mighty Moose a.k.a. ContinuousTests it actually warns you about untested code and is the only code coverage tool for .NET that is free.

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

Sidebar

Related Questions

Apple really had bad documentation about how the provider connects and communicates to their
I'm having troubles finding a bad query that's really causing high CPU load due
I've used TFS for about 18 months now and I'm really not excited about
To being with, Im really bad with PHP, not my area. Sorry for any
I've been using JSLint to make me feel bad about my JavaScript. It is
I feel bad about not getting this. But, although I have read several articles
I'm developing on a really bad code-base that is loosely formed around Zend Framework
I have clients with really bad networks, including bad mappings at the gateways and
Sorry I'm really bad at regexes, I finally hacked osmething to work in ruby.
Maybe I'm having a really bad day, but could someone possibly help me to

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.