public void AddCurrentRoute_CorrectData_RouteCreated() { CourierDto courier = new CourierDto() { FirstName = "Courier", LastName = "With route", PhoneNumber = "test" }; Guid id = courierService.AddCourierAsync(courier).Result; RouteDto route = new RouteDto() { Created = DateTime.Now, Points = new List <PointDto> { new PointDto { Latitude = 49.8333981, Longitude = 24.0125249 }, new PointDto { Latitude = 49.8306805, Longitude = 24.034673 }, new PointDto { Latitude = 49.8388715, Longitude = 24.0311097 } } }; Guid routeId = routeService.AddRouteAsync(id, route).Result; Assert.IsTrue(routeId != Guid.Empty); }
public async Task <IHttpActionResult> StartDelivery(Guid courierId, DeliveryDto delivery) { foreach (var order in delivery.Orders) { await OrderService.ChangeOrderStateAsync(order, OrderStateDto.Fulfillment); } await RouteService.AddRouteAsync(courierId, delivery.Route); await CourierService.ChangeCourierStateAsync(courierId, CourierStateDto.PerformsDelivery); return(Ok()); }