Beispiel #1
0
        public async Task AcceptOrder_WhenCalled_ReturnsExpectedAcceptOrderResponse()
        {
            var taxiCompanyId = "someId";
            var orderId       = 1;

            var orderDto = new OrderDto
            {
                Id     = orderId,
                Price  = 200,
                Rides  = null,
                Status = RideStatus.WaitingForAccept.ToString()
            };

            _mapper.Map <OrderDto>(null).ReturnsForAnyArgs(orderDto);
            var order       = new Order();
            var taxicompany = new TaxiCompany();

            _unitOfWork.OrderRepository.FindByIDAsync(null).ReturnsForAnyArgs(order);
            _unitOfWork.TaxiCompanyRepository.FindByIDAsync(null).ReturnsForAnyArgs(taxicompany);

            var expectedResponse = new AcceptOrderResponse {
                Order = orderDto
            };

            var response = await _orderService.AcceptOrderAsync(taxiCompanyId, orderId);

            Assert.That(response.Order, Is.EqualTo(expectedResponse.Order));
        }