public static void Update(this Comment destination, CommentDTO source) { destination.Message = source.Message; destination.State = source.State; }
public void ShouldAddComments() { var httpResult = controller.Get(1); var response = httpResult as JsonResult<CandidateDTO>; var candidate = response.Content; var newComment = new CommentDTO { Message = "Message" }; var newCommentsList = candidate.Comments.ToList(); newCommentsList.Add(newComment); candidate.Comments = newCommentsList; var newHttpResult = controller.Put(candidate.Id, candidate); var newResponse = newHttpResult as JsonResult<CandidateDTO>; var newCandidate = newResponse.Content; Assert.IsTrue(newCandidate.Comments.Any(x => x.Message == "Message")); }