public void TestInitializeState()
 {
     EZMoneyModel ezMoneyModel = new EZMoneyModel(); // TODO: 初始化為適當值
     ezMoneyModel.GetCategories().Clear();
     ezMoneyModel.GetRecords().Clear();
     CategoryPresentationModel categoryPModel = new CategoryPresentationModel(ezMoneyModel); // TODO: 初始化為適當值
     categoryPModel.InitializeState();
     Assert.AreEqual(false, categoryPModel.IsSelectionMode);
     Assert.AreEqual(false, categoryPModel.IsModifyEnable);
     Assert.AreEqual(false, categoryPModel.IsDeleteEnable);
     Assert.AreEqual(false, categoryPModel.IsCancelEnable);
     Assert.AreEqual(String.Empty, categoryPModel.CategoryNameText);
     Assert.AreEqual(false, categoryPModel.IsAddEnable);
 }
 public void TestModify()
 {
     EZMoneyModel ezMoneyModel = new EZMoneyModel(); // TODO: 初始化為適當值
     ezMoneyModel.GetCategories().Clear();
     ezMoneyModel.GetRecords().Clear();
     CategoryPresentationModel categoryPModel = new CategoryPresentationModel(ezMoneyModel); // TODO: 初始化為適當值
     categoryPModel.InitializeState();
     Category category = new Category(CATEGORY_NAME_WORK);
     ezMoneyModel.AddCategory(category);
     Assert.AreEqual(CATEGORY_NAME_WORK, ezMoneyModel.GetCategories()[0].CategoryName);
     categoryPModel.Modify(0, CATEGORY_NAME_MOVIE);
     Assert.AreEqual(CATEGORY_NAME_MOVIE, ezMoneyModel.GetCategories()[0].CategoryName);
 }
 public void TestSelectCategory()
 {
     EZMoneyModel ezMoneyModel = new EZMoneyModel(); // TODO: 初始化為適當值
     ezMoneyModel.GetCategories().Clear();
     ezMoneyModel.GetRecords().Clear();
     CategoryPresentationModel categoryPModel = new CategoryPresentationModel(ezMoneyModel); // TODO: 初始化為適當值
     categoryPModel.InitializeState();
     categoryPModel.SelectCategory(-1);
     Assert.AreEqual(false, categoryPModel.IsSelectionMode);
     Assert.AreEqual(false, categoryPModel.IsModifyEnable);
     Assert.AreEqual(false, categoryPModel.IsDeleteEnable);
     Assert.AreEqual(false, categoryPModel.IsCancelEnable);
     Category category = new Category(CATEGORY_NAME_WORK);
     ezMoneyModel.AddCategory(category);
     categoryPModel.SelectCategory(0);
     Assert.AreEqual(true, categoryPModel.IsSelectionMode);
     Assert.AreEqual(true, categoryPModel.IsModifyEnable);
     Assert.AreEqual(true, categoryPModel.IsDeleteEnable);
     Assert.AreEqual(true, categoryPModel.IsCancelEnable);
     Assert.AreEqual(CATEGORY_NAME_WORK, categoryPModel.CategoryNameText);
     Assert.AreEqual(false, categoryPModel.IsAddEnable);
 }
 public void TestIsValidCategoryAdd()
 {
     EZMoneyModel ezMoneyModel = new EZMoneyModel(); // TODO: 初始化為適當值
     ezMoneyModel.GetCategories().Clear();
     ezMoneyModel.GetRecords().Clear();
     CategoryPresentationModel categoryPModel = new CategoryPresentationModel(ezMoneyModel); // TODO: 初始化為適當值
     categoryPModel.InitializeState();
     string errorMessage = string.Empty;
     Assert.IsTrue(categoryPModel.IsValidCategoryAdd(CATEGORY_NAME_WORK, ref errorMessage));
     Assert.AreEqual(String.Empty, errorMessage);
     Assert.IsFalse(categoryPModel.IsValidCategoryAdd(String.Empty, ref errorMessage));
     Assert.AreEqual(CategoryPresentationModel.CATEGORY_NO_NAME_INFO, errorMessage);
     Category category = new Category(CATEGORY_NAME_WORK);
     ezMoneyModel.AddCategory(category);
     Assert.IsFalse(categoryPModel.IsValidCategoryAdd(CATEGORY_NAME_WORK, ref errorMessage));
     Assert.AreEqual(CategoryPresentationModel.CATEGORY_REPEAT_INFO, errorMessage);
 }