Ejemplo n.º 1
0
        public void TestGetCategoryIndex()
        {
            CategoryModel categoryModel = new CategoryModel();
            Category      categoryMovie = new Category(CATEGORY_NAME_MOVIE);
            Category      categoryWork  = new Category(CATEGORY_NAME_WORK);

            categoryModel.AddCategory(categoryMovie);
            categoryModel.AddCategory(categoryWork);
            Assert.AreEqual(0, categoryModel.GetCategoryIndex(categoryMovie));
            Assert.AreEqual(1, categoryModel.GetCategoryIndex(categoryWork));
        }
Ejemplo n.º 2
0
        public void TestGetCategoryModel()
        {
            EZMoneyModel  ezMoneyModel  = new EZMoneyModel();                // TODO: 初始化為適當值
            Category      movieCategory = new Category(CATEGORY_NAME_MOVIE); // TODO: 初始化為適當值
            Category      workCategory  = new Category(CATEGORY_NAME_WORK);  // TODO: 初始化為適當值
            CategoryModel categoryModel = ezMoneyModel.CategoryModel;

            categoryModel.AddCategory(movieCategory);
            categoryModel.AddCategory(workCategory);
            Assert.AreEqual(0, categoryModel.GetCategoryIndex(movieCategory));
            Assert.AreEqual(1, categoryModel.GetCategoryIndex(workCategory));
        }