public void TestUpdateArchived()
        {
            Payment p1 = createValidPayment();

            p1.Archived = true;
            p1.Note     = "Moved to archive";
            paymentCollection.Update(p1);

            List <Payment> expectedArchivedPayments = new List <Payment>()
            {
                p1
            };
            List <Payment> actualArchivedPayments = paymentCollection.ReadAllArchived();

            CollectionAssert.AreEqual(expectedArchivedPayments, actualArchivedPayments);

            List <Payment> expectedOutgoingPayments = new List <Payment>();
            List <Payment> actualOutgoingPayments   = paymentCollection.ReadAllOutgoing();

            CollectionAssert.AreEqual(expectedOutgoingPayments, actualOutgoingPayments);

            List <Payment> expectedIncomingPayments = new List <Payment>();
            List <Payment> actualIncomingPayments   = paymentCollection.ReadAllIncoming();

            CollectionAssert.AreEqual(expectedIncomingPayments, actualIncomingPayments);
        }
        public void TestReadAllOutgoing()
        {
            Payment p1 = createValidPayment();

            p1.Note = "Outgoing1";
            Payment p2 = createValidPayment();

            p1.Note = "Outgoing2";
            Payment p3 = createValidPayment();

            p1.Note = "Outgoing3";

            PaymentCollection paymentCollection = new PaymentCollection(dataAccessFacadeStub);

            List <Payment> expectedPayments = new List <Payment>()
            {
                p1, p2, p3
            };
            List <Payment> actualPayments = paymentCollection.ReadAllOutgoing();

            for (int i = 0; i < expectedPayments.Count; i++)
            {
                Assert.AreEqual(expectedPayments[i].Note, actualPayments[i].Note);
                Assert.AreEqual(expectedPayments[i].Payee.Name, actualPayments[i].Payee.Name);
                Assert.AreEqual(expectedPayments[i].Payer.Name, actualPayments[i].Payer.Name);
            }
        }
        public void TestReadAllOutgoing()
        {
            Payment p1 = createValidPayment();
            p1.Note = "Outgoing1";
            Payment p2 = createValidPayment();
            p1.Note = "Outgoing2";
            Payment p3 = createValidPayment();
            p1.Note = "Outgoing3";

            PaymentCollection paymentCollection = new PaymentCollection(dataAccessFacadeStub);

            List<Payment> expectedPayments = new List<Payment>() { p1, p2, p3 };
            List<Payment> actualPayments = paymentCollection.ReadAllOutgoing();

            for (int i = 0; i < expectedPayments.Count; i++)
            {
                Assert.AreEqual(expectedPayments[i].Note, actualPayments[i].Note);
                Assert.AreEqual(expectedPayments[i].Payee.Name, actualPayments[i].Payee.Name);
                Assert.AreEqual(expectedPayments[i].Payer.Name, actualPayments[i].Payer.Name);
            }
        }