示例#1
0
        public void DateRangeTest()
        {
            var testRecord = new SSE662Project1.Objects.Record(recordname);

            testRecord.AddExpense(testExpense);
            DateTime[] testrange = { testdate, testdate2 };
            Assert.NotEqual(testRecord.DateRange(), testrange);
            testRecord.AddExpense(testExpense2);
            Assert.Equal(testRecord.DateRange(), testrange);
        }
示例#2
0
        static void Main(string[] args)
        {
            // Create variables
            Record        ZacRecord = new Record("Zac's record");
            string        file1     = @"C:\Users\Maggie\Desktop\School Stuff\Masters\Spring 2019\Chase.CSV";
            FileReader    f         = new FileReader();
            List <string> categoryTotals;

            f.ReadFromFile(file1, ZacRecord); // Populate ZacRecord from file1
            Console.WriteLine(ZacRecord);     // Print ZacRecord

            // Populate categoryTotals from ZacRecord and print them out
            categoryTotals = ZacRecord.CategoryTotals();
            for (int i = 0; i < categoryTotals.Count; i++)
            {
                Console.WriteLine(categoryTotals[i]);
            }

            // Print out range of dates from ZacRecord
            Console.WriteLine("Start date: " + ZacRecord.DateRange()[0]);
            Console.WriteLine("End date: " + ZacRecord.DateRange()[1]);
            Console.ReadLine();
        }