Inheritance: Tp.Integration.Common.DataTransferObject, ICommentDTO
コード例 #1
0
		public hOOt.Document CreateComment(CommentDTO comment)
		{
			var name = EntityDocument.CreateName(comment.CommentID);
			var text = _textOperations.Prepare(string.Format("{0}", comment.Description ?? string.Empty));
			return new hOOt.Document(name, text)
			{
				DocNumber = -1
			};
		}
コード例 #2
0
		private string GetOwner(CommentDTO comment)
		{
			var owner = _userMapper.GetThirdPartyIdBy(comment.OwnerID);
			return !string.IsNullOrEmpty(owner)
			       	? owner
			       	: _repository.Get<UserDTO>(comment.OwnerID.ToString())
			       	  	.Select(x => x.Email)
			       	  	.SingleOrDefault();
		}
コード例 #3
0
		public IBugzillaAction GetCommentAction(CommentDTO comment, TimeSpan offset)
		{
			var bugzillaBug = _bugzillaStorage.GetBugzillaBug(comment.GeneralID);
			var owner = GetOwner(comment);

			return new BugzillaCommentAction(
				bugzillaBug.Id,
				comment.Description,
				owner,
				comment.CreateDate.GetValueOrDefault().ToUniversalTime().Add(offset));
		}
コード例 #4
0
		protected override ITargetProcessCommand CreateCommand()
		{
			var dto = new CommentDTO {GeneralID = EntityId, Description = Comment, OwnerID = UserId};
			return new CreateCommand {Dto = dto};
		}
		private void CreateCommentInTargetProcess(string commentText, string owner, int? bugId, DateTime createDate)
		{
			var comment = new CommentDTO
			              	{
			              		Description = commentText,
			              		OwnerID = Context.Users.Single(u => u.Login == owner).ID,
			              		GeneralID = bugId,
								CreateDate = createDate
			              	};

			TransportMock.HandleMessageFromTp(new CommentCreatedMessage
			                                  	{
			                                  		Dto = comment
			                                  	});
		}
		private ISagaMessage GetCommentCreateCommandSuccessfulMessage(CreateCommand x)
		{
			var commandDto = (CommentDTO) x.Dto;
			_createdCommentDto = new CommentDTO
			{
				OwnerID = commandDto.OwnerID,
				GeneralID = commandDto.GeneralID,
				Description = commandDto.Description
			};
			return new CommentCreatedMessage {Dto = _createdCommentDto};
		}