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[0], service.PersonList[1],service.PersonList[2]); service.addDebt(100, service.PersonList[1], service.PersonList[2], service.PersonList[0]); service.addDebt(100, service.PersonList[2], service.PersonList[0], service.PersonList[1]); service.Combine(); Assert.AreEqual(service.DebtList.Count, 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[0], service.PersonList[1], service.PersonList[2]); service.addDebt(100, service.PersonList[1], service.PersonList[2], service.PersonList[0]); service.addDebt(100, service.PersonList[2], service.PersonList[0], service.PersonList[1]); service.Combine(); Assert.AreEqual(service.DebtList.Count, 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); }