Ejemplo n.º 1
0
        public void Test_Person_AddPayoutObligation()
        {
            Person person = new Person("Test Name");
            person.AddPayoutObligation("Test creditor", 23.45m);

            Assert.AreEqual("Test creditor", person.PayoutObligations[0].Key);
            Assert.AreEqual(23.45m, person.PayoutObligations[0].Value);
        }
Ejemplo n.º 2
0
        public void Test_Person_AddPayoutObligation_KVP()
        {
            Person person = new Person("Test Name");
            person.AddPayoutObligation(new KeyValuePair<string, decimal>("Test creditor", 23.45m));

            Assert.AreEqual("Test creditor", person.PayoutObligations[0].Key);
            Assert.AreEqual(23.45m, person.PayoutObligations[0].Value);
        }
Ejemplo n.º 3
0
        public void Test_Person_ToString()
        {
            Person person = new Person("Test Name");
            person.AddExpense(10.25m);
            person.AddPayoutObligation("Test creditor", 23.45m);

            StringBuilder sb = new StringBuilder();
            sb.AppendLine("Person Name: Test Name");
            sb.AppendLine("Expense: 10.25");
            sb.AppendLine("Payout Obligation: 23.45 to Test creditor");

            Assert.AreEqual(sb.ToString(), person.ToString());
        }