Example #1
0
        public void ContainsTest()
        {
            LedgerBook book = getSampleBook();

            Console.WriteLine("Generating Item contained in the collection");
            LedgerItem containedItem = LedgerItem.Create(new DateTime(1997, 3, 12), "Sales Profit", LedgerItemCreateMode.Credit, 23);

            containedItem.Parent = book;

            Console.WriteLine("containedItem:" + containedItem);

            Console.WriteLine("Is the item contained in book? " + book.Contains(containedItem));

            Console.WriteLine("Generating Item not contained in the collection");

            LedgerItem notContainedItem = LedgerItem.Create(new DateTime(2091, 6, 27), "Budget to create rocket", LedgerItemCreateMode.Credit, 664773.68);

            Console.WriteLine("notContainedItem:" + notContainedItem);

            Console.WriteLine("Is the item not contained in book? " + book.Contains(notContainedItem));
        }