コード例 #1
0
        public async Task GivenAnId_WhenDeleteAsync_ThenReturnTrue()
        {
            var ticket = TicketsFactory.AddedTicket(_database.DbContext);

            var result = await _repository.DeleteAsync(ticket.Id);

            result.Should().BeTrue();
        }
コード例 #2
0
        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>();
        }
コード例 #3
0
        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>();
        }