Beispiel #1
0
        public void GivenTestData2OutputGroupedList()
        {
            StatementViewModel subject = Arrange();

            subject.SortByBucket = true;
            subject.UpdateGroupedByBucket();

            foreach (TransactionGroupedByBucketViewModel group in subject.GroupedByBucket)
            {
                Console.WriteLine(
                    "{0}, AvgDr:{1:C} {2:d} {3:d} Count:{4} TotalCr:{5:C} TotalDr{6:C} Diff{7:C}",
                    group.Bucket,
                    group.AverageDebit,
                    group.MinTransactionDate,
                    group.MaxTransactionDate,
                    group.TotalCount,
                    group.TotalCredits,
                    group.TotalDebits,
                    group.TotalDifference);
                foreach (Transaction transaction in group.Transactions)
                {
                    Console.WriteLine(
                        "     {0:d} {1:C} {2}",
                        transaction.Date,
                        transaction.Amount,
                        transaction.Description);
                }
            }
        }
Beispiel #2
0
        public void GivenSortByDateUpdateGroupedByBucketShouldNotUpdateGroupedList()
        {
            StatementViewModel subject = Arrange();

            subject.SortByBucket = true;
            subject.SortByDate   = true;
            subject.UpdateGroupedByBucket();
            Assert.IsFalse(subject.GroupedByBucket.Any());
        }