public void TestUpdateLocations() { string userID = 20.ToString(CultureInfo.InvariantCulture); var request = new AddLocationsRequest { UserID = userID, Locations = new List<Location> { new Location { ID = Guid.NewGuid().ToString(), Latitude = 123.123123, Longitude = 345.345345, Radius = 123123, Data = new List<Data> { new Data { ID = Guid.NewGuid().ToString(), Name = Guid.NewGuid().ToString(), Text = Guid.NewGuid().ToString(), }, new Data { ID = Guid.NewGuid().ToString(), Name = Guid.NewGuid().ToString(), Text = Guid.NewGuid().ToString(), }, new Data { ID = Guid.NewGuid().ToString(), Name = Guid.NewGuid().ToString(), Text = Guid.NewGuid().ToString(), } } }, new Location { ID = Guid.NewGuid().ToString(), Latitude = 123.123123, Longitude = 345.345345, Radius = 123123, Data = new List<Data> { new Data { ID = Guid.NewGuid().ToString(), Name = Guid.NewGuid().ToString(), Text = Guid.NewGuid().ToString(), }, } }, new Location { ID = Guid.NewGuid().ToString(), Latitude = 123.123123, Longitude = 345.345345, Radius = 123123, }, } }; controller.UpdateLocations(request).Wait(); var locations = controller.GetLocations(userID).Result; }
public async Task<IHttpActionResult> UpdateLocations(AddLocationsRequest request) { await locationStorageProvider.Save(request.UserID, request.Locations); return Ok(); }