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 GetAuthorizationContextForService_ShouldReturnContext() { //------------Setup for test-------------------------- var terminateExecution = new TerminateExecution(); //------------Execute Test--------------------------- var resId = terminateExecution.GetAuthorizationContextForService(); //------------Assert Results------------------------- Assert.AreEqual(AuthorizationContext.Any, resId); }
public void GetResourceID_ShouldReturnEmptyGuid() { //------------Setup for test-------------------------- var terminateExecution = new TerminateExecution(); //------------Execute Test--------------------------- var resId = terminateExecution.GetResourceID(new Dictionary <string, StringBuilder>()); //------------Assert Results------------------------- Assert.AreEqual(Guid.Empty, resId); }
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()); }
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()); }