?
Solved

Class parameter and run

Posted on 2011-09-02
2
Medium Priority
?
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
Wouter Boevink earned 2000 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

PowerShell Core for Advanced Linux Administrators

Understand advanced principals around Powershell Core with a focus on the Linux Administrator.  This course covers how to administer numerous environments across multiple platforms including Linux, Azure, AWS, and Google Cloud from a single shell instance.

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…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

762 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