public void FindNearbyPeople() { // Arrange var Matchmaking = new Matchmaking(); int postCode = 3000; int radius = 20; // Act int[] nearbyAreaCodes = Matchmaking.FindNearbyPeople(postCode, radius); // Analyze = foreach (var areaCode in nearbyAreaCodes) { TestContext.WriteLine(areaCode.ToString()); } string postnummer = string.Empty; for (int i = 0; i < nearbyAreaCodes.Length; i++) { if (i == 0) { postnummer = postnummer + $"{nearbyAreaCodes[i]}"; continue; } postnummer = postnummer + $",{nearbyAreaCodes[i]}"; } TestContext.WriteLine(postnummer); // Assert Assert.IsNotNull(nearbyAreaCodes); }
public async void LoadProfiles() { int postalCode = _profileRepo.GetProfilePostalcode(ProfileID); var matchmaking = new Matchmaking(); int[] nearbyMAtches = matchmaking.FindNearbyPeople(postalCode, 30); AllProfiles = new ObservableCollection <Profiles>(await _profileRepo.GetProfileAsync()); NearbyProfiles = new ObservableCollection <Profiles>(AllProfiles.Where(c => nearbyMAtches.Contains(c.FK_Postalcode))); }