예제 #1
0
        public async void getCrimeLocationsTest()
        {
            LocationApi locationApi = new LocationApi();
            PoliceApi policeApi = new PoliceApi();

            // start date first of february
            DateTime startDate = new DateTime(2018, 2, 1);

            // end date 28th of February
            DateTime endDate = new DateTime(2018, 2, 28);

            LocationData locData = locationApi.getLocationData("norwich");

            string category = "bicycle-theft";

            int expectedCount = 34;

            List<Location> locations = await policeApi.getCrimeLocations(locData, startDate, endDate, category);







        }
예제 #2
0
        public async void getCrimeLocationsTest()
        {
            Debug.WriteLine("policeApiTest");

            // Integrated location API
            LocationApi locationApi = new LocationApi();
            PoliceApi   policeApi   = new PoliceApi();

            // start date first of february
            DateTime startDate = new DateTime(2018, 2, 1);

            // end date 28th of February
            DateTime endDate = new DateTime(2018, 2, 28);

            LocationData locData = locationApi.getLocationData("norwich");

            string category = "bicycle-theft";

            int expectedCount = 34;

            List <Location> locations = await policeApi.getCrimeLocations(locData, startDate, endDate, category);

            int actualCount = locations.Count;

            Assert.AreEqual(expectedCount, actualCount);
        }
예제 #3
0
        public void getLocationDataTest()
        {
            LocationApi locationApi = new LocationApi();

            // established correct values from observed Bing Api output
            double expectedLat = 51.506420135498;
            double expectedLng = -0.127210006117821;

            string testLocation = "london";

            // actual output from LocationApi class
            LocationData actual = locationApi.getLocationData(testLocation);

            // Assert expected outputs match actual output
            Assert.AreEqual(expectedLat, actual.CentrePoint.Latitude);
            Assert.AreEqual(expectedLng, actual.CentrePoint.Longitude);
        }