Exemple #1
0
        public void UninstallService_WhenMachineNameIsNullOrEmpty_ThrowsArgumentExcpetion()
        {
            var ntServiceManager = new ScExeBasedNtServiceManager("c:\\", new TimeSpan(1));

            Assert.Throws <ArgumentException>(() => ntServiceManager.UninstallService(string.Empty, "serviceName"));
        }
Exemple #2
0
        public void StopService_WhenServiceNameIsNullOrEmpty_ThrowsArgumentExcpetion()
        {
            var ntServiceManager = new ScExeBasedNtServiceManager("c:\\", new TimeSpan(1));

            Assert.Throws <ArgumentException>(() => ntServiceManager.StopService("machineName", string.Empty));
        }
Exemple #3
0
        public void InstallService_WhenNtServiceDescriptorIsNull_ThrowsArgumentException()
        {
            var ntServiceManager = new ScExeBasedNtServiceManager("c:\\", new TimeSpan(1));

            Assert.Throws <ArgumentNullException>(() => ntServiceManager.InstallService("machineName", null));
        }