public void PartyRepository_GerParties_ShouldGetPartyList() { //--Arrange List <Party> parties = _partyRepo.GetParties(); //--Act int actual = parties.Count; int expected = 0; //--Assert Assert.AreEqual(expected, actual); }
public List <Party> GetParties() { List <Party> retList = new List <Party>(); // List of all Parties with their answers to iterate.... List <Party> iterateList = partyRepos.GetParties().Select(Mapping.PartyDbToContract).ToList(); // ... and to calculate the connection score List <Party> calcList = partyRepos.GetParties().Select(Mapping.PartyDbToContract).ToList(); foreach (var party in iterateList) { retList.Add(party.SetConnectionScores(calcList)); } return(retList); }
private async Task <Boolean> GetParties() { this.Parties = await PartyRepository.GetParties(); RaiseAll(); if (this.Parties.Count > 0) { return(true); } else { return(false); } }
public void TestMethod1() { PartyRepository boothRepo = new PartyRepository(); List <Party> testPartyList = boothRepo.GetParties(); int partyNumber = 1; var testFoodList = new List <Food>() { new Food("Hamburger", 20, 3.50m), }; var testBoothList = new List <Booth>() { new Booth(BoothType.Food, testFoodList, 25.00m), }; Party testParty = new Party(testBoothList, partyNumber); testPartyList.Add(testParty); var expected = 1; var actual = testPartyList.Count; Assert.AreEqual(expected, actual); }
private async Task GetParties() { parties_all = await PartyRepository.GetParties(); if (parties_all != null) { for (int i = 0; i < parties_all.Count; i++) { try { Party item = parties_all[i]; if (item.Location == null) { break; } item.VisibleShow = Visibility.Collapsed; item.ShowCommand = new RelayCommand <object>(e => ShowParty(e)); item.RouteCommand = new RelayCommand <object>(e => mapItem_Party(e)); item.TakeCommand = new RelayCommand <object>(e => TakeParty(e)); item.RouteCommandText = "Toon route"; if (MainViewVM.USER.IsBob.Value) { item.VisibleTake = Visibility.Collapsed; } else { item.VisibleTake = Visibility.Visible; } BasicGeoposition tempbasic = new BasicGeoposition(); //Locaties omzetten en in de tijdelijke posities opslaan. tempbasic.Latitude = ((Location)item.Location).Latitude; tempbasic.Longitude = ((Location)item.Location).Longitude; //Omzetten van tijdelijk punt naar echte locatie (anders krijg je die niet in de mapIconFeestLocation.Location) Geopoint temppoint = new Geopoint(tempbasic); MapIcon mapIconFeestLocation = new MapIcon(); mapIconFeestLocation.Location = temppoint; //Opgehaalde locatie //mapIconFeestLocation.Title = feest.Name; //Naam van het feestje; mapIconFeestLocation.Image = MainViewVM.Pins.FeestPin; mapIconFeestLocation.Title = item.Name; this.Map.MapElements.Add(mapIconFeestLocation);//Marker op de map zetten. } catch (Exception ex) { } } try { var newControl = new MapItemsControl(); FeestjesOverzicht view = MainViewVM.MainFrame.Content as FeestjesOverzicht; newControl.ItemsSource = parties_all; newControl.ItemTemplate = (DataTemplate)view.Resources["PartiesMapTemplate"] as DataTemplate; AddOrUpdateChild(newControl); } catch (Exception) { } this.Parties = parties_all.Take(10).ToList(); RaiseAll(); } }