public async Task Queries_for_tag(string tagName, [Frozen] IApi zendesk, Watcher sut)
        {
            await sut.GetTicketsForSharing();

            await zendesk.Received().SearchTickets(
                Verify.That <string>(x => x.Should().Contain($"tags:{tagName}")));
        }
        public async Task Handles_null_results([Frozen] IApi zendesk, Watcher sut)
        {
            zendesk.SearchTickets(Arg.Any <string>())
            .Returns((SearchResponse)null);

            var result = await sut.GetTicketsForSharing();

            result.Should().BeEmpty();
        }
        public async Task Filters_out_tickets_returned_by_api_that_do_not_have_tag([Frozen] IApi zendesk, Watcher sut, Ticket ticket)
        {
            ticket.Tags.Clear();
            zendesk.SearchTickets(Arg.Any <string>())
            .Returns(SearchResponse.Create(ticket));

            var result = await sut.GetTicketsForSharing();

            result.Should().BeEmpty();
        }
        public async Task Returns_all_tickets_with_tag(string tagName, [Frozen] IApi zendesk, Watcher sut, Ticket ticket)
        {
            ticket.Tags = new List <string> {
                tagName
            };
            zendesk.SearchTickets(Arg.Any <string>())
            .Returns(SearchResponse.Create(ticket));

            var result = await sut.GetTicketsForSharing();

            result.Should().Contain(ticket.Id);
        }
        private async Task TicketIsMarkedForSharing(long id)
        {
            var ticket = await watcher.GetTicketsForSharing();

            ticket.Should().Contain(id);
        }