Exemplo n.º 1
0
        public void Get_ValidLocations_ReturnAsGeoHashPath()
        {
            var trackingRepository = new Mock <ITrackingRepository>();

            trackingRepository.Setup(tp => tp.Get())
            .Returns(
                new List <Tracking>
            {
                new Tracking {
                    Location = new Location(53.125, 18.011111)
                },
                new Tracking {
                    Location = new Location(53.125, 18.011111)
                },
                new Tracking {
                    Location = new Location(53.125, 18.011111)
                }
            });

            ITrackingService trackingService = new TrackingService(null, trackingRepository.Object);

            var result = trackingService.GetPathAsGeoHash();

            Assert.That(result, Is.EqualTo("u3ky1z5793cb,u3ky1z5793cb,u3ky1z5793cb"));
        }
Exemplo n.º 2
0
        public IActionResult GetPath()
        {
            string path = trackingService.GetPathAsGeoHash();

            return(Ok(path));
        }