Search code examples
c#geolocationlocationuwp

Unit testing geofencing services in UWP


I have an app that shows a notification when I arrive somewhere, and I would like to have unit testing for it. I searched around a bit, and couldn't find anything.

  1. Can I do this?
  2. Are there services out there for this?
  3. If not, what is the best way to do this?

Solution

  • This is pretty easy, thanks to the awesome Windows Phone emulator and it’s tools. enter image description here

    1. Press the “Additional tools” button
    2. Select the “Location” tab
    3. Select the “Load” button(If you don't have file,please set a point on map and save it as Locations.xml file by clicking save a pointbutton)
    4. Edit Locations.xml file with visual studio, setting latitude and longitude same as your application setting.
    5. Create new points next to the previous one continually.
    6. The press the “Play” button on the Location Tools Now if you have done everything right, pretty soon you should see the first toast pop up, and they should appear in the notification center as well. Since the phone should move on walking speed (it’s a pedestrian area) you might need to wait for a while for them all to appear.

    enter image description here