I have a class at the moment and within this class it has 15 or so private methods that perform certain tasks on a loop run by a timer. Some of these methods call of to the database and some don't.
The question is...how can I arrange these so that I can setup the class so I can fake a repos or executing process??
This is a simplified version of what I have now.
public class Manager : IManager
{
System.Timers.Timer tm;
private bool runningAsService;
private List<Database> Databases = new List<Database>();
private LogClass Log;
public Manager(bool RunningAsService, LogClass log)
{
runningAsService = RunningAsService;
Log = log;
tm = new System.Timers.Timer(Settings.idle_time * 1000);
tm.Elapsed += new System.Timers.ElapsedEventHandler(delegate { PerformDuties(); });
}
public void Start()
{
tm.Start();
PerformDuties();
}
private PerformDuties()
{
//Call the other 10-15 private methods to perform all the tasks needed.
}
}