samedi 24 janvier 2015

How should I unit test starting a Windows service that is already running

I'm quite new to TDD and fine rained unit testing, and this issue as me a little stumped. I know it's more an integration test, but, hey.



{
var status = _ealsServiceController.Status;
if (status == ServiceControllerStatus.Running || status == ServiceControllerStatus.StartPending)
{
// Say something. Do something.
}
_ealsServiceController.Start();
Assert.AreEqual(ServiceControllerStatus.Running, _ealsServiceController.Status, "The EALS Service could not be started.");
}


What do I do where I say I must say and do something? Assert.Inconclusive()?


Aucun commentaire:

Enregistrer un commentaire