public void TestThatDetermineCrimeRatingIsNotFalse()
        {
            CrimeDataService dataService = new CrimeDataService();
            // Test using Ashfield data
            var result = dataService.DetermineCrimeRatingIndex(265.7);

            Assert.AreEqual(2, result);
        }
        public void TestDetermineCrimeRatingForPenrith2015()
        {
            CrimeDataService dataService = new CrimeDataService();
            // Test using Ashfield data
            var result = dataService.DetermineCrimeRatingIndex(527.4);

            Assert.AreEqual(3, result);
        }
Esempio n. 3
0
        public CrimeDataViewModel Get(double latitude, double longitude)
        {
            var service     = new CrimeDataService();
            var lgaAndScore = service.DetermineLga(latitude, longitude);
            var lga         = lgaAndScore.First().Key;
            var index       = service.DetermineCrimeRatingIndex(lgaAndScore[lga]);

            return(new CrimeDataViewModel()
            {
                Lat = latitude,
                Long = longitude,
                LGAName = lga,
                CrimeRatingIndex = index,
                Rate = lgaAndScore[lga]
            });
        }