I recieve an old project and start to refactor it for SUT purposes. I use Moq and NUnit framework. I met next class inside this project:
public ServerRunner()
{
Name = ConfigurationManager.AppSettings["ServiceName"];
WinService = new ServiceController(Name);
logger = new Logger.Logger(Name);
syncRoot = new ReaderWriterLockSlim();
timeoutMilliseconds = 10000;
}
I am new in unit test world so I need advice - how can I extract and mock System.ServiceController class? Can it be done by Moq or I should use some other Mock frameworks?
Aucun commentaire:
Enregistrer un commentaire