Solved

Class parameter and run

Posted on 2011-09-02
2
192 Views
Last Modified: 2013-12-17
Hello team,

I've got class #1 that takes several parameters then performs an action.  One of the parameters is for a unit test class.  All unit test classes will have a 'Run' method but will have differing test logic, since every unit test is different.  How do I setup class #1 to call the 'Run' method on dynamically changing unit test classes being passed in?  Is this a place to use declare an interface?
0
Comment
Question by:Phil5780
2 Comments
 
LVL 12

Accepted Solution

by:
Wouter Boevink earned 500 total points
ID: 36474337
Actually an interface could help you to your solution however I'm a little concerned about the used methodology.
All you test code should be in your Unit Tests, the production code should not be aware of (or contain) the test methods.

Basicly it should be something like this:

You write your class.
You write your function
You test that function with a unit test

You are the one that runs the unit tests not your class. Or maybe I don't understand the question.
0
 

Author Closing Comment

by:Phil5780
ID: 36711401
Thanks, interfaces were exactly what I needed.
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question