Пример #1
0
        public void ActionFailsOnServiceSpecificName()
        {
            WinServiceAction controlServiceAction = new WinServiceAction()
            {
                Status      = 1,
                Wait        = false,
                WaitTimeout = 0
            };

            var actionResult = controlServiceAction.Execute(ArgumentCollection.New());

            Assert.IsNotNull(actionResult);
            Assert.IsFalse(actionResult.Result);
            Assert.IsNotNull(actionResult.AttachedException);
        }
Пример #2
0
        public void ActionFailsOnWrongStatusToAct()
        {
            WinServiceAction controlServiceAction = new WinServiceAction()
            {
                ServiceName = "YOUNESCHEIKH",
                Status      = 28,
                Wait        = false,
                WaitTimeout = 0
            };

            var actionResult = controlServiceAction.Execute(ArgumentCollection.New());

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