Inheritance: IEsbManagementEndpoint
 public void CreateServiceEntryExpectsDynamicService()
 {
     var terminateExecution = new TerminateExecution();
     var ds = terminateExecution.CreateServiceEntry();
     Assert.AreEqual(HandleType, terminateExecution.HandlesType());
     Assert.AreEqual(enActionType.InvokeManagementDynamicService, ds.Actions.First().ActionType);
     Assert.AreEqual("<DataList><Roles ColumnIODirection=\"Input\"/><ResourceID ColumnIODirection=\"Input\"/><Dev2System.ManagmentServicePayload ColumnIODirection=\"Both\"></Dev2System.ManagmentServicePayload></DataList>", ds.DataListSpecification.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());
 }
        public void ExecuteExpectSuccessResult()
        {
            ExecutableServiceRepository.Instance.Clear();
            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());

        }
        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());
        }