public async Task GivenAnId_WhenDeleteAsync_ThenReturnTrue() { var ticket = TicketsFactory.AddedTicket(_database.DbContext); var result = await _repository.DeleteAsync(ticket.Id); result.Should().BeTrue(); }
public async Task GivenAnUserIdAndConsultantId_WhenGetByUserIdAndConsultantIdAsync_ThenReturnAnTicket() { var ticket = TicketsFactory.AddedTicket(_database.DbContext); var result = await _repository.GetByUserIdAndConsultantIdAsync(ticket.UserId, ticket.ConsultantId); result.Should().NotBeNull(); result.Should().BeOfType <Ticket>(); }
public async Task GivenATicket_WhenUpdate_ThenReturnTicketUpdated() { var ticket = TicketsFactory.AddedTicket(_database.DbContext); var updatedTicket = TicketsFactory.UpdateValidTicket(ticket.UserId, ticket.ConsultantId); var result = await _repository.UpdateAsync(updatedTicket); result.Should().BeOfType <Ticket>(); }