public ViewModel() { _debtService = new DebtService(); AddNewPerson = new DelegateCommand(OnAddNewPerson); AddDebt = new DelegateCommand(OnAddDebt); Evaluate = new DelegateCommand(OnEvaluate); peopleSharing = new List<Person>(); personList = new ObservableCollection<Person>(); }
public ViewModel() { _debtService = new DebtService(); AddNewPerson = new DelegateCommand(OnAddNewPerson); AddDebt = new DelegateCommand(OnAddDebt); Evaluate = new DelegateCommand(OnEvaluate); peopleSharing = new List <Person>(); personList = new ObservableCollection <Person>(); }
public void EveryoneBreakEven() { DebtService service = new DebtService(); service.PersonList.Add(new Person("Adam")); service.PersonList.Add(new Person("Kate")); service.PersonList.Add(new Person("Dru")); service.addDebt(100, service.PersonList.ElementAt(0), service.PersonList.ElementAt(1)); service.addDebt(100, service.PersonList.ElementAt(1), service.PersonList.ElementAt(2)); service.addDebt(100, service.PersonList.ElementAt(2), service.PersonList.ElementAt(0)); service.Combine(); ObservableCollection<DebtContainer> emptyList = new ObservableCollection<DebtContainer>(); Console.WriteLine(emptyList.Count); Console.WriteLine(service.DebtList.Count); Assert.True(true); Assert.AreEqual(service.DebtList, emptyList); }