public void OnWorkitemCreated() { var workitem = new Story("Title", "description", "project", "owners"); var workitemResult = new WorkitemCreationResult(workitem) { Source = { ExternalId = ExternalId, }, Permalink = "link", }; workitemResult.Messages.Add("external id"); FullUpdateJiraIssue(ExternalId, config.OnCreateFieldName, config.OnCreateFieldValue, workitemResult.Messages, config.ProgressWorkflow, null); UpdateWorkitemLinkInJira(workitemResult); Repository.ReplayAll(); reader.OnWorkitemCreated(workitemResult); Repository.VerifyAll(); }
public void OnWorkitemCreated() { var workitem = new Story("Title", "description", "project", "owners", "priority"); var workitemResult = new WorkitemCreationResult(workitem) { Source = { ExternalId = ExternalId, }, Permalink = "link", }; workitemResult.Messages.Add("external id"); ; Expect.Call(ServiceFactory.CreateNew(Url)).Repeat.Times(3).Return(SoapService); Expect.Call(SoapService.Dispose).Repeat.Times(3); FullUpdateJiraIssue(ExternalId, config.OnCreateFieldName, config.OnCreateFieldValue, workitemResult.Messages, config.ProgressWorkflow, null); UpdateWorkitemLinkInJira(workitemResult); Repository.ReplayAll(); reader.OnWorkitemCreated(workitemResult); Repository.VerifyAll(); }
public void OnWorkitemCreatedInsufficientPermissions() { var workitem = new Story("Title", "description", "project", "owners", "priority"); var workitemResult = new WorkitemCreationResult(workitem) { Source = { ExternalId = ExternalId, }, Permalink = "link", }; workitemResult.Messages.Add("external id"); ; Expect.Call(ServiceFactory.CreateNew(Url)).Repeat.Twice().Return(SoapService); Expect.Call(SoapService.Dispose).Repeat.Twice(); Expect.Call(SoapService.Login(Username, Password)).Return(Token); Expect.Call(SoapService.UpdateIssue(Token, ExternalId, config.OnCreateFieldName, config.OnCreateFieldValue)).Throw(new JiraException("Can't update issue", new Exception())); Expect.Call(SoapService.Logout(Token)).Return(true); UpdateWorkitemLinkInJira(workitemResult); Repository.ReplayAll(); reader.OnWorkitemCreated(workitemResult); Repository.VerifyAll(); }
public void OnWorkitemCreatedInsufficientPermissions() { var workitem = new Story("Title", "description", "project", "owners"); var workitemResult = new WorkitemCreationResult(workitem) { Source = { ExternalId = ExternalId, }, Permalink = "link", }; workitemResult.Messages.Add("external id"); Expect.Call(ConnectorMock.Login); Expect.Call(ConnectorMock.UpdateIssue(ExternalId, config.OnCreateFieldName, config.OnCreateFieldValue)).Throw(new JiraException("Can't update issue", new Exception())); Expect.Call(ConnectorMock.Logout); UpdateWorkitemLinkInJira(workitemResult); Repository.ReplayAll(); reader.OnWorkitemCreated(workitemResult); Repository.VerifyAll(); }