public void Test_Expenses_ProjectedCashFlow_GetExistingMonthlyListing_Null(
            DateTime startAt,
            DateTime endAt,
            DateTime at)
        {
            var cashFlow = new ProjectedCashFlow(startAt, endAt);

            Assert.That(cashFlow.GetMonthlyListing(at.Year, at.Month).IsPrediction, Is.False);
            Assert.That(cashFlow.GetMonthlyListing(at.Year, at.Month).IsNull, Is.True);
            Assert.That(cashFlow.GetMonthlyListing(at.Year, at.Month).Credit, Is.EqualTo(0.00M));
            Assert.That(cashFlow.GetMonthlyListing(at.Year, at.Month).Debit, Is.EqualTo(0.00M));
        }
Esempio n. 2
0
        private IEnumerable <IMonthlyListing> GetExistingMonthlyListings(DateTime startAt, DateTime endAt)
        {
            var cashFlow = new ProjectedCashFlow(startAt, endAt);

            for (var date = cashFlow.StartAt; date < cashFlow.EndAt; date = date.AddMonths(1))
            {
                IMonthlyListing result;
                try
                {
                    result = cashFlow.GetMonthlyListing(date.Year, date.Month);
                }
                catch (ArgumentException exception)
                {
                    Console.WriteLine(exception);

                    continue;
                }

                yield return(result);
            }
        }