Exemplo n.º 1
0
        public void WinServiceFailsOnNoNameSpcified()
        {
            WinServiceWatcher winServiceStatusWatcher = new WinServiceWatcher()
            {
                Status = 1
            };
            var watcherResult = winServiceStatusWatcher.Watch();

            Assert.IsNotNull(watcherResult);
            Assert.IsFalse(watcherResult.Result);
            Assert.IsNotNull(watcherResult.AttachedException);
        }
Exemplo n.º 2
0
        public void WinServiceFailsOnNotExistingService()
        {
            WinServiceWatcher winServiceStatusWatcher = new WinServiceWatcher()
            {
                ServiceName = "YOUNESCHEIKH",
                Status      = 1
            };
            var watcherResult = winServiceStatusWatcher.Watch();

            Assert.IsNotNull(watcherResult);
            Assert.IsFalse(watcherResult.Result);
            Assert.IsNotNull(watcherResult.AttachedException);
        }