Esempio n. 1
0
        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>();
        }
Esempio n. 2
0
        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>();
        }
Esempio n. 3
0
        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);
        }