Пример #1
0
        public void TestGetPositiveRecords()
        {
            CategoryModel categoryModel = new CategoryModel();
            Category      categoryMovie = new Category(CATEGORY_NAME_MOVIE);
            Category      categoryWork  = new Category(CATEGORY_NAME_WORK);

            categoryModel.AddCategory(categoryMovie);
            categoryModel.AddCategory(categoryWork);
            RecordModel recordModel         = new RecordModel(categoryModel);
            DateTime    now                 = DateTime.Now;
            DateTime    date                = new DateTime(now.Year, now.Month, now.Day);
            Record      recordMoviePositive = new Record(date, categoryMovie, 100);
            Record      recordMovieNegative = new Record(date, categoryMovie, -100);
            Record      recordWorkPositive  = new Record(date, categoryWork, 100);
            Record      recordWorkNegative  = new Record(date, categoryWork, -100);

            recordModel.AddRecord(recordMoviePositive);
            recordModel.AddRecord(recordMovieNegative);
            recordModel.AddRecord(recordWorkPositive);
            recordModel.AddRecord(recordWorkNegative);
            BindingList <Record> positiveRecords = recordModel.GetPositiveRecords(recordModel.Records);

            Assert.AreEqual(2, positiveRecords.Count);
        }