public void CrimeFretcherCanFetchACrimeSomewhereNearALocation() { var crimeFretcher = new CrimeFetcher(); var mosiLocation = new Location(-2.255562, 53.476788); var crimeList = crimeFretcher.FetchCrimesNearLocation(mosiLocation); Assert.AreNotEqual(0, crimeList.Count); }
public Crime GetARandomCrime() { CrimeFetcher crimeFetcher = new CrimeFetcher(); var crimelist = crimeFetcher.FetchSomeCrimes(); if (crimelist.Count > 0) return crimelist[0]; return new Crime(); }
public void TestMethod1() { var crimeFretcher = new CrimeFetcher(); var mosiLocation = new Location(-2.255562, 53.476788); var crimeList = crimeFretcher.FetchCrimesNearLocation(mosiLocation); var northEastDirection = new NorthEastDirection(x => x.Location.Longitude > mosiLocation.Longitude && x.Location.Latitude > mosiLocation.Latitude, crimeList, mosiLocation); var numberOfCrimesToTheNorthEast = northEastDirection.Count; Assert.AreNotEqual(numberOfCrimesToTheNorthEast, crimeList.Count); }
public Crime GetACrimeSomewhereNearLocation(double lat, double lng) { var location = new Location(lng, lat); var crimeFetcher = new CrimeFetcher(); var crimelist = crimeFetcher.FetchCrimesNearLocation(location); if (crimelist.Count > 0) return crimelist[0]; return new Crime(); }
public Direction BestDirection() { var crimeFetcher = new CrimeFetcher(); var crimelist = crimeFetcher.FetchCrimesNearLocation(location); if (crimelist.Count > 0) { NorthEastDirection northEastDirection = new NorthEastDirection( x => x.Location.Longitude > location.Longitude && x.Location.Latitude > location.Latitude, crimelist, location); } return new Direction() { Name = "North East", Bearing = 45, Count = 5 }; }
public void CrimeFretcherCanFetchACrime() { var crimeFretcher = new CrimeFetcher(); var crimeList = crimeFretcher.FetchSomeCrimes(); Assert.AreNotEqual(0, crimeList.Count); }