public void ExecuteExpectFailResultIfNoServiceExist()
        {
            ExecutableServiceRepository.Instance.Clear();
            const string Expected           = "Message: Failed to stop the workflow execution. It may have completed already.";
            var          terminateExecution = new TerminateExecution();
            var          result             = terminateExecution.Execute(GetDictionary(), GetWorkspace().Object);

            var obj = ConvertToMsg(result.ToString());

            Assert.AreEqual(Expected, obj.Message.ToString());
        }
        public void ExecuteExpectTaskTerminated()
        {
            ExecutableServiceRepository.Instance.Clear();
            var service = GetExecutableService();

            ExecutableServiceRepository.Instance.Add(service.Object);
            var terminateExecution = new TerminateExecution();

            terminateExecution.Execute(GetDictionary(), GetWorkspace().Object);
            service.Verify(s => s.Terminate(), Times.Once());
        }
示例#3
0
        public void ExecuteExpectSuccessResult()
        {
            var service = GetExecutableService();

            ExecutableServiceRepository.Instance.Add(service.Object);
            var terminateExecution = new TerminateExecution();
            var result             = terminateExecution.Execute(GetDictionary(), GetWorkspace().Object);

            const string Expected = "Message: Workflow successfully terminated";
            var          obj      = ConvertToMsg(result.ToString());

            Assert.AreEqual(Expected, obj.Message.ToString());
        }