public async Task Sends_nothing_to_middleware_when_there_are_no_tagged_comments( [Frozen] FakeZendeskApi zendesk, [Frozen] Middleware.IApi middleware, Watcher sut, [Frozen] AuditedComment comment, [Pending.Escalated] Ticket ticket ) { // Given comment.AuditTagEvent.Value = ""; zendesk.Tickets.Add(ticket); // When await sut.ShareTicket(ticket.Id); // Then await middleware.DidNotReceive().EscalateTicket(Arg.Any <Middleware.EventWrapper>()); }
public async Task Sends_ticket_to_middleware_with_tagged_comment( [Frozen] FakeZendeskApi zendesk, [Frozen] Middleware.IApi middleware, Watcher sut, [Frozen] AuditedComment comment, [Pending.Escalated] Ticket ticket) { // Given var auditTagEvent = comment.AuditTagEvent.Value = "escalated_tag"; zendesk.Tickets.Add(ticket); // When await sut.ShareTicket(ticket.Id); // Then var mwt = new { Ticket = new { Comments = new[] { new { comment.Id } } } }; await middleware.Received().EscalateTicket( Verify.That <Middleware.EventWrapper>(x => x.Should().BeEquivalentTo(mwt))); }
public void AuditedCommentMapping(AuditedComment comment) { comment.Id.Should().Be(comment.AsAudit.Events[^ 1].Id);