public async Task ShouldListDeletedTickets() { var tickets = CreateTickets(2); var retrievedTickets = (await _resource.GetAllAsync()).ToArray(); Assert.Equal(2, retrievedTickets.Length); Assert.Equal(JsonConvert.SerializeObject(tickets[0]), JsonConvert.SerializeObject(retrievedTickets[0])); Assert.Equal(JsonConvert.SerializeObject(tickets[1]), JsonConvert.SerializeObject(retrievedTickets[1])); }
public async Task GetAllAsync_WhenCalled_ShouldGetAll() { var results = await _resource.GetAllAsync(); Assert.Equal(100, results.Count); for (var i = 1; i <= 100; i++) { var ticket = results.ElementAt(i - 1); Assert.Equal(i, ticket.Id); Assert.Equal($"My printer is on fire! {i}", ticket.Subject); Assert.Equal(i.ToString(), ticket.ExternalId); Assert.Equal(i, ticket.OrganisationId); Assert.Equal(i, ticket.RequesterId); Assert.Equal(i, ticket.AssigneeId); } }