Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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);
        }