public void HasSpecificMessageForDescriptionChanged() { var comparer = new ZendeskTicketTracker(null, null, null).m_ZendeskTicketCompareEngine; var responses = comparer.Compare(new[] { new Update <ZendeskTicket>("a-channel", new ZendeskTicket("12345", "a-description", "open", new ZendeskTicket.Comment[3]), new ZendeskTicket("12345", "a-description updated", "open", new ZendeskTicket.Comment[3])), }); Assert.AreEqual("<https://redgatesupport.zendesk.com/agent/tickets/12345|ZD#12345> (a-description updated) updated: description updated", responses.Single().Response.Message); }
public void DoesNotNotifyForPendingOrHold() { var comparer = new ZendeskTicketTracker(null, null, null).m_ZendeskTicketCompareEngine; var responses = comparer.Compare(new[] { new Update <ZendeskTicket>("a-channel", new ZendeskTicket("12345", "a-description", "pending", new ZendeskTicket.Comment[3]), new ZendeskTicket("12345", "a-description", "hold", new ZendeskTicket.Comment[3])), }); CollectionAssert.IsEmpty(responses); }
public void UsesAvatarAsImageIfSingleCommentPosted() { var comparer = new ZendeskTicketTracker(null, null, null).m_ZendeskTicketCompareEngine; var comment = new ZendeskTicket.Comment("a-comment", "some person", "an-avatar"); var responses = comparer.Compare(new[] { new Update <ZendeskTicket>("a-channel", new ZendeskTicket("12345", "a-description", "open", new ZendeskTicket.Comment[0]), new ZendeskTicket("12345", "a-description updated", "closed", new[] { comment })), }); Assert.AreEqual("an-avatar", responses.Single().Response.Image); }
public void GroupsTogetherMessagesForMultipleChanges() { var comparer = new ZendeskTicketTracker(null, null, null).m_ZendeskTicketCompareEngine; var comment = new ZendeskTicket.Comment("a-comment", "some person", "an-avatar"); var responses = comparer.Compare(new[] { new Update <ZendeskTicket>("a-channel", new ZendeskTicket("12345", "a-description", "open", new ZendeskTicket.Comment[0]), new ZendeskTicket("12345", "a-description updated", "closed", new[] { comment })), }); Assert.AreEqual("<https://redgatesupport.zendesk.com/agent/tickets/12345|ZD#12345> (a-description updated) updated: some person added a comment, `open` → `closed`, description updated", responses.Single().Response.Message); }