Solved

Class parameter and run

Posted on 2011-09-02
2
190 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Select datagridview rows by range or numbers 11 23
How do I get the id from URL? 19 47
SQl help with selection 14 44
Expando 4 34
Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now