Beispiel #1
0
        public void ShouldNotifyLandmarkCloseIfExists()
        {
            landmarks.Setup(r => r.GetWithinZone(It.IsAny <double>(), It.IsAny <double>(), It.IsAny <double>(), It.IsAny <int>(), It.IsAny <int>())).Returns(GetFakeLandmarks());
            Task <bool> task = testService.NotifyIfCloseToLandmark("aToken", -34.9185678, -56.1674899);

            landmarks.Verify(r => r.GetWithinZone(-34.9185678, -56.1674899, It.IsAny <double>(), It.IsAny <int>(), It.IsAny <int>()));
            Assert.IsTrue(task.Result);
        }
 public IActionResult UpdateLocation(string token, [FromQuery] double lat, [FromQuery] double lng)
 {
     //Notification will be sent by firebase.
     service.NotifyIfCloseToLandmark(token, lat, lng);
     //Wether it is sent or not in the end, we return OK. It is not urgent that the notification is sent.
     return(Ok(new { Message = "Updated successfully" }));
 }